summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/test_filelist.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-09-21 13:01:54 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-09-21 13:01:54 (GMT)
commit03d5d087989fc38df2bee68a3f5ed758b0bfa665 (patch)
tree7a1341e9e5dac79d1d4c84fbae2cdaf2f9723f94 /Lib/distutils/tests/test_filelist.py
parenteb097fca52f47d012df127c7c83d72a8e3881d73 (diff)
downloadcpython-03d5d087989fc38df2bee68a3f5ed758b0bfa665.zip
cpython-03d5d087989fc38df2bee68a3f5ed758b0bfa665.tar.gz
cpython-03d5d087989fc38df2bee68a3f5ed758b0bfa665.tar.bz2
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_filelist.py')
-rw-r--r--Lib/distutils/tests/test_filelist.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_filelist.py b/Lib/distutils/tests/test_filelist.py
index cf64c74..d98325a 100644
--- a/Lib/distutils/tests/test_filelist.py
+++ b/Lib/distutils/tests/test_filelist.py
@@ -1,7 +1,10 @@
"""Tests for distutils.filelist."""
from os.path import join
import unittest
+from test.support import captured_stdout
+
from distutils.filelist import glob_to_re, FileList
+from distutils import debug
MANIFEST_IN = """\
include ok
@@ -59,6 +62,22 @@ class FileListTestCase(unittest.TestCase):
self.assertEquals(file_list.files, wanted)
+ def test_debug_print(self):
+ file_list = FileList()
+ with captured_stdout() as stdout:
+ file_list.debug_print('xxx')
+ stdout.seek(0)
+ self.assertEquals(stdout.read(), '')
+
+ debug.DEBUG = True
+ try:
+ with captured_stdout() as stdout:
+ file_list.debug_print('xxx')
+ stdout.seek(0)
+ self.assertEquals(stdout.read(), 'xxx\n')
+ finally:
+ debug.DEBUG = False
+
def test_suite():
return unittest.makeSuite(FileListTestCase)