diff options
Diffstat (limited to 'Lib/distutils/tests/test_filelist.py')
-rw-r--r-- | Lib/distutils/tests/test_filelist.py | 19 |
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) |