summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/test_install.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-09-21 12:19:07 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-09-21 12:19:07 (GMT)
commit6d2db3784aff7f85aa4b814e7312e599b124498e (patch)
treeb122a9f20ca1ac4e6bd4d9da4f9d825678b1d1d7 /Lib/distutils/tests/test_install.py
parent1d18b5b92919493526ed021d83479777f0bb6700 (diff)
downloadcpython-6d2db3784aff7f85aa4b814e7312e599b124498e.zip
cpython-6d2db3784aff7f85aa4b814e7312e599b124498e.tar.gz
cpython-6d2db3784aff7f85aa4b814e7312e599b124498e.tar.bz2
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.py14
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..d2b8c8e 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.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)