summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-09-21 13:43:09 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-09-21 13:43:09 (GMT)
commite7631191b0051af2ac1ed8f6121b548545540c0f (patch)
treecc601077b9952f607738076b52ae12c370f08296 /Lib/distutils/tests
parent03d5d087989fc38df2bee68a3f5ed758b0bfa665 (diff)
downloadcpython-e7631191b0051af2ac1ed8f6121b548545540c0f.zip
cpython-e7631191b0051af2ac1ed8f6121b548545540c0f.tar.gz
cpython-e7631191b0051af2ac1ed8f6121b548545540c0f.tar.bz2
Merged revisions 74992 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r74992 | tarek.ziade | 2009-09-21 15:23:35 +0200 (Mon, 21 Sep 2009) | 1 line improving distutils coverage ........
Diffstat (limited to 'Lib/distutils/tests')
-rw-r--r--Lib/distutils/tests/test_dist.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_dist.py b/Lib/distutils/tests/test_dist.py
index 9f795f4..91297f0 100644
--- a/Lib/distutils/tests/test_dist.py
+++ b/Lib/distutils/tests/test_dist.py
@@ -8,6 +8,7 @@ import warnings
from distutils.dist import Distribution, fix_help_options
from distutils.cmd import Command
+import distutils.dist
from test.support import TESTFN, captured_stdout
from distutils.tests import support
@@ -55,6 +56,27 @@ class DistributionTestCase(support.LoggingSilencer,
d.parse_command_line()
return d
+ def test_debug_mode(self):
+ with open(TESTFN, "w") as f:
+ f.write("[global]")
+ f.write("command_packages = foo.bar, splat")
+
+ files = [TESTFN]
+ sys.argv.append("build")
+
+ with captured_stdout() as stdout:
+ self.create_distribution(files)
+ stdout.seek(0)
+ self.assertEquals(stdout.read(), '')
+ distutils.dist.DEBUG = True
+ try:
+ with captured_stdout() as stdout:
+ self.create_distribution(files)
+ stdout.seek(0)
+ self.assertEquals(stdout.read(), '')
+ finally:
+ distutils.dist.DEBUG = False
+
def test_command_packages_unspecified(self):
sys.argv.append("build")
d = self.create_distribution()