Kaydet (Commit) fda7fe01 authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Restore old distutils logging threshold after running test_log.

üst d7a44155
...@@ -14,8 +14,8 @@ class TestLog(unittest.TestCase): ...@@ -14,8 +14,8 @@ class TestLog(unittest.TestCase):
# error handler) # error handler)
old_stdout = sys.stdout old_stdout = sys.stdout
old_stderr = sys.stderr old_stderr = sys.stderr
old_threshold = log.set_threshold(log.DEBUG)
try: try:
log.set_threshold(log.DEBUG)
with NamedTemporaryFile(mode="w+", encoding='ascii') as stdout, \ with NamedTemporaryFile(mode="w+", encoding='ascii') as stdout, \
NamedTemporaryFile(mode="w+", encoding='ascii') as stderr: NamedTemporaryFile(mode="w+", encoding='ascii') as stderr:
sys.stdout = stdout sys.stdout = stdout
...@@ -27,6 +27,7 @@ class TestLog(unittest.TestCase): ...@@ -27,6 +27,7 @@ class TestLog(unittest.TestCase):
stderr.seek(0) stderr.seek(0)
self.assertEqual(stderr.read().rstrip(), "fatal:\\xe9") self.assertEqual(stderr.read().rstrip(), "fatal:\\xe9")
finally: finally:
log.set_threshold(old_threshold)
sys.stdout = old_stdout sys.stdout = old_stdout
sys.stderr = old_stderr sys.stderr = old_stderr
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment