diff options
-rw-r--r-- | Lib/distutils/tests/test_core.py | 2 | ||||
-rw-r--r-- | Lib/distutils/tests/test_dist.py | 2 | ||||
-rw-r--r-- | Lib/test/test_shutil.py | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/Lib/distutils/tests/test_core.py b/Lib/distutils/tests/test_core.py index 57856f19b6..27ce7324af 100644 --- a/Lib/distutils/tests/test_core.py +++ b/Lib/distutils/tests/test_core.py @@ -9,6 +9,7 @@ import test.support from test.support import captured_stdout, run_unittest import unittest from distutils.tests import support +from distutils import log # setup script that uses __file__ setup_using___file__ = """\ @@ -51,6 +52,7 @@ class CoreTestCase(support.EnvironGuard, unittest.TestCase): self.old_stdout = sys.stdout self.cleanup_testfn() self.old_argv = sys.argv, sys.argv[:] + self.addCleanup(log.set_threshold, log._global_log.threshold) def tearDown(self): sys.stdout = self.old_stdout diff --git a/Lib/distutils/tests/test_dist.py b/Lib/distutils/tests/test_dist.py index b7fd3fbf90..1f104cef67 100644 --- a/Lib/distutils/tests/test_dist.py +++ b/Lib/distutils/tests/test_dist.py @@ -13,6 +13,7 @@ from distutils.cmd import Command from test.support import TESTFN, captured_stdout, run_unittest from distutils.tests import support +from distutils import log class test_dist(Command): @@ -405,6 +406,7 @@ class MetadataTestCase(support.TempdirManager, support.EnvironGuard, def test_show_help(self): # smoke test, just makes sure some help is displayed + self.addCleanup(log.set_threshold, log._global_log.threshold) dist = Distribution() sys.argv = [] dist.help = 1 diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 522959a3fc..8db1089ec8 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -1037,7 +1037,7 @@ class TestShutil(unittest.TestCase): # now create another tarball using `tar` tarball2 = os.path.join(root_dir, 'archive2.tar') tar_cmd = ['tar', '-cf', 'archive2.tar', base_dir] - with support.change_cwd(root_dir), captured_stdout(): + with support.change_cwd(root_dir): spawn(tar_cmd) self.assertTrue(os.path.isfile(tarball2)) |