diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-09-21 13:10:05 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-09-21 13:10:05 (GMT) |
commit | 83496698249fbcfd0efb875d882a6e883db4bf6d (patch) | |
tree | b7c466f0156cd565341483fca2fcec347c487ea0 /Lib/distutils/tests/test_install.py | |
parent | 14214261c418bff713dd67fcf5cd6db69fa7e77e (diff) | |
download | cpython-83496698249fbcfd0efb875d882a6e883db4bf6d.zip cpython-83496698249fbcfd0efb875d882a6e883db4bf6d.tar.gz cpython-83496698249fbcfd0efb875d882a6e883db4bf6d.tar.bz2 |
Merged revisions 74990 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r74990 | tarek.ziade | 2009-09-21 15:01:54 +0200 (Mon, 21 Sep 2009) | 9 lines
Merged revisions 74988 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r74988 | tarek.ziade | 2009-09-21 14:19:07 +0200 (Mon, 21 Sep 2009) | 1 line
improved distutils test coverage: now the DEBUG mode is covered too (will help fix the issue #6954 in py3k branch)
........
................
Diffstat (limited to 'Lib/distutils/tests/test_install.py')
-rw-r--r-- | Lib/distutils/tests/test_install.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py index d0ad5ce..2087a0e 100644 --- a/Lib/distutils/tests/test_install.py +++ b/Lib/distutils/tests/test_install.py @@ -6,6 +6,8 @@ import sys import unittest import site +from test.support import captured_stdout + from distutils.command.install import install from distutils.command import install as install_module from distutils.command.install import INSTALL_SCHEMES @@ -14,7 +16,6 @@ from distutils.errors import DistutilsOptionError from distutils.tests import support - class InstallTestCase(support.TempdirManager, support.LoggingSilencer, unittest.TestCase): @@ -183,6 +184,17 @@ class InstallTestCase(support.TempdirManager, with open(cmd.record) as f: self.assertEquals(len(f.readlines()), 1) + def test_debug_mode(self): + # this covers the code called when DEBUG is set + old_logs_len = len(self.logs) + install_module.DEBUG = True + try: + with captured_stdout() as stdout: + self.test_record() + finally: + install_module.DEBUG = False + self.assertTrue(len(self.logs) > old_logs_len) + def test_suite(): return unittest.makeSuite(InstallTestCase) |