diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-11-12 11:28:07 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-11-12 11:28:07 (GMT) |
commit | 30c49cb17fab6538c8b25ddb19c4f0ab04097eff (patch) | |
tree | 86245e83100569cfffcf852918de75c7f951dade /Lib | |
parent | 12ab296f8212029f43e17f4745abcef89f34ea32 (diff) | |
parent | ef2462ea3f736c9920c03750d2ea08d4835ffc2d (diff) | |
download | cpython-30c49cb17fab6538c8b25ddb19c4f0ab04097eff.zip cpython-30c49cb17fab6538c8b25ddb19c4f0ab04097eff.tar.gz cpython-30c49cb17fab6538c8b25ddb19c4f0ab04097eff.tar.bz2 |
Restore old distutils logging threshold after running test_log.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/distutils/tests/test_log.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/distutils/tests/test_log.py b/Lib/distutils/tests/test_log.py index ce66ee5..0c2ad7a 100644 --- a/Lib/distutils/tests/test_log.py +++ b/Lib/distutils/tests/test_log.py @@ -14,8 +14,8 @@ class TestLog(unittest.TestCase): # error handler) old_stdout = sys.stdout old_stderr = sys.stderr + old_threshold = log.set_threshold(log.DEBUG) try: - log.set_threshold(log.DEBUG) with NamedTemporaryFile(mode="w+", encoding='ascii') as stdout, \ NamedTemporaryFile(mode="w+", encoding='ascii') as stderr: sys.stdout = stdout @@ -27,6 +27,7 @@ class TestLog(unittest.TestCase): stderr.seek(0) self.assertEqual(stderr.read().rstrip(), "fatal:\\xe9") finally: + log.set_threshold(old_threshold) sys.stdout = old_stdout sys.stderr = old_stderr |