From ccaf380fabaf09362de926a648b131114b33e90b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarek=20Ziad=C3=A9?= Date: Mon, 21 Sep 2009 13:23:35 +0000 Subject: improving distutils coverage --- Lib/distutils/tests/test_dist.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Lib/distutils/tests/test_dist.py b/Lib/distutils/tests/test_dist.py index 75b74a2..553f30c 100644 --- a/Lib/distutils/tests/test_dist.py +++ b/Lib/distutils/tests/test_dist.py @@ -9,6 +9,7 @@ import warnings from distutils.dist import Distribution, fix_help_options from distutils.cmd import Command +import distutils.dist from test.test_support import TESTFN, captured_stdout from distutils.tests import support @@ -56,6 +57,27 @@ class DistributionTestCase(support.TempdirManager, 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() -- cgit v0.12