diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-31 16:15:52 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-31 16:15:52 (GMT) |
commit | 19402331022fa73a93fe6b82617ba1dd84d67557 (patch) | |
tree | 83d9d779576251592ada627eab34d16883ac9b26 /Lib/test/test_faulthandler.py | |
parent | 0cc8d59069c1f8404ffbf2e235ea1c2c41d9969b (diff) | |
download | cpython-19402331022fa73a93fe6b82617ba1dd84d67557.zip cpython-19402331022fa73a93fe6b82617ba1dd84d67557.tar.gz cpython-19402331022fa73a93fe6b82617ba1dd84d67557.tar.bz2 |
Issue #11393: check that stdout is empty if we use a file
Diffstat (limited to 'Lib/test/test_faulthandler.py')
-rw-r--r-- | Lib/test/test_faulthandler.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py index 4544c4c..1a3f5e2 100644 --- a/Lib/test/test_faulthandler.py +++ b/Lib/test/test_faulthandler.py @@ -53,12 +53,13 @@ class FaultHandlerTests(unittest.TestCase): process = script_helper.spawn_python('-c', code, **options) stdout, stderr = process.communicate() exitcode = process.wait() + output = support.strip_python_stderr(stdout) + output = output.decode('ascii', 'backslashreplace') if filename: + self.assertEqual(output, '') with open(filename, "rb") as fp: output = fp.read() - else: - output = support.strip_python_stderr(stdout) - output = output.decode('ascii', 'backslashreplace') + output = output.decode('ascii', 'backslashreplace') output = re.sub('Current thread 0x[0-9a-f]+', 'Current thread XXX', output) @@ -262,6 +263,8 @@ funcA() def test_dump_traceback(self): self.check_dump_traceback(None) + + def test_dump_traceback_file(self): with temporary_filename() as filename: self.check_dump_traceback(filename) @@ -327,6 +330,8 @@ Current thread XXX: def test_dump_traceback_threads(self): self.check_dump_traceback_threads(None) + + def test_dump_traceback_threads_file(self): with temporary_filename() as filename: self.check_dump_traceback_threads(filename) |