cpython: d7741afd8347 (original) (raw)
Mercurial > cpython
changeset 99085:d7741afd8347 2.7
Issue #25607: Restore old distutils logging threshold after running tests that parse command line arguments. [#25607]
Serhiy Storchaka storchaka@gmail.com | |
---|---|
date | Thu, 12 Nov 2015 19:46:23 +0200 |
parents | 2fb9f769603a |
children | b95c10cb457d |
files | Lib/distutils/tests/test_core.py Lib/distutils/tests/test_dist.py Lib/test/test_shutil.py |
diffstat | 3 files changed, 5 insertions(+), 1 deletions(-)[+] [-] Lib/distutils/tests/test_core.py 2 Lib/distutils/tests/test_dist.py 2 Lib/test/test_shutil.py 2 |
line wrap: on
line diff
--- a/Lib/distutils/tests/test_core.py +++ b/Lib/distutils/tests/test_core.py @@ -9,6 +9,7 @@ import test.test_support from test.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__ = """[](#l1.10) @@ -36,6 +37,7 @@ class CoreTestCase(support.EnvironGuard, self.old_stdout = sys.stdout self.cleanup_testfn() self.old_argv = sys.argv, sys.argv[:]
self.addCleanup(log.set_threshold, log._global_log.threshold)[](#l1.15)
def tearDown(self): sys.stdout = self.old_stdout
--- a/Lib/distutils/tests/test_dist.py +++ b/Lib/distutils/tests/test_dist.py @@ -13,6 +13,7 @@ from distutils.cmd import Command import distutils.dist from test.test_support import TESTFN, captured_stdout, run_unittest, unlink from distutils.tests import support +from distutils import log class test_dist(Command): @@ -397,6 +398,7 @@ class MetadataTestCase(support.TempdirMa def test_show_help(self): # smoke test, just makes sure some help is displayed
self.addCleanup(log.set_threshold, log._global_log.threshold)[](#l2.15) dist = Distribution()[](#l2.16) sys.argv = [][](#l2.17) dist.help = 1[](#l2.18)
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -443,7 +443,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():[](#l3.7)
with support.change_cwd(root_dir):[](#l3.8) spawn(tar_cmd)[](#l3.9)