cpython: e91de993964c (original) (raw)
Mercurial > cpython
changeset 69083:e91de993964c
Issue #11393: check that stdout is empty if we use a file [#11393]
Victor Stinner victor.stinner@haypocalc.com | |
---|---|
date | Thu, 31 Mar 2011 18:15:52 +0200 |
parents | bdc946dc512a |
children | 976a07bdcd64 |
files | Lib/test/test_faulthandler.py |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-)[+] [-] Lib/test/test_faulthandler.py 11 |
line wrap: on
line diff
--- a/Lib/test/test_faulthandler.py +++ b/Lib/test/test_faulthandler.py @@ -53,12 +53,13 @@ class FaultHandlerTests(unittest.TestCas process = script_helper.spawn_python('-c', code, **options) stdout, stderr = process.communicate() exitcode = process.wait()
output = support.strip_python_stderr(stdout)[](#l1.7)
output = output.decode('ascii', 'backslashreplace')[](#l1.8) if filename:[](#l1.9)
self.assertEqual(output, '')[](#l1.10) with open(filename, "rb") as fp:[](#l1.11) output = fp.read()[](#l1.12)
else:[](#l1.13)
output = support.strip_python_stderr(stdout)[](#l1.14)
output = output.decode('ascii', 'backslashreplace')[](#l1.15)
output = output.decode('ascii', 'backslashreplace')[](#l1.16) output = re.sub('Current thread 0x[0-9a-f]+',[](#l1.17) 'Current thread XXX',[](#l1.18) output)[](#l1.19)
@@ -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) +