summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-11-12 11:15:41 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-11-12 11:15:41 (GMT)
commitfda7fe01484a3a53a6ba3365629e567488c73803 (patch)
treeac43feaf54d178ab39c9aa56363d177cae272fda /Lib/distutils
parentd7a441559921804a5a6141c3ec42f896f8f3b010 (diff)
downloadcpython-fda7fe01484a3a53a6ba3365629e567488c73803.zip
cpython-fda7fe01484a3a53a6ba3365629e567488c73803.tar.gz
cpython-fda7fe01484a3a53a6ba3365629e567488c73803.tar.bz2
Restore old distutils logging threshold after running test_log.
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/tests/test_log.py3
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