[Python-checkins] r74996 - in python/branches/py3k: Lib/distutils/tests/test_dist.py

tarek.ziade python-checkins at python.org
Mon Sep 21 15:43:09 CEST 2009


Author: tarek.ziade
Date: Mon Sep 21 15:43:09 2009
New Revision: 74996

Log:
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
........


Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Lib/distutils/tests/test_dist.py

Modified: python/branches/py3k/Lib/distutils/tests/test_dist.py
==============================================================================
--- python/branches/py3k/Lib/distutils/tests/test_dist.py	(original)
+++ python/branches/py3k/Lib/distutils/tests/test_dist.py	Mon Sep 21 15:43:09 2009
@@ -8,6 +8,7 @@
 
 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 @@
         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()


More information about the Python-checkins mailing list