summaryrefslogtreecommitdiff
path: root/tests/test_process.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-12-26 09:37:47 -0500
committerNed Batchelder <ned@nedbatchelder.com>2016-12-26 09:37:47 -0500
commitcab19c985170aa63675ee12dcc7d8a467578fa7a (patch)
treefb147ec3d510445ce5a36ffe7092dd2054be6548 /tests/test_process.py
parent23e043d78879a75b09a5eb90fe096e4c2771326f (diff)
downloadpython-coveragepy-cab19c985170aa63675ee12dcc7d8a467578fa7a.tar.gz
Make excepthook execution more accurate. Pypy tests failing
Diffstat (limited to 'tests/test_process.py')
-rw-r--r--tests/test_process.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test_process.py b/tests/test_process.py
index a714862..8615537 100644
--- a/tests/test_process.py
+++ b/tests/test_process.py
@@ -836,7 +836,10 @@ class ExcepthookTest(CoverageTest):
import sys
def excepthook(*args):
- print('in excepthook')
+ # Write this message to stderr so that we don't have to deal
+ # with interleaved stdout/stderr comparisons in the assertions
+ # in the test.
+ sys.stderr.write('in excepthook\\n')
raise RuntimeError('Error Inside')
sys.excepthook = excepthook
@@ -846,7 +849,7 @@ class ExcepthookTest(CoverageTest):
cov_st, cov_out = self.run_command_status("coverage run test_excepthook_exit.py")
py_st, py_out = self.run_command_status("python test_excepthook_exit.py")
self.assertEqual(cov_st, py_st)
- self.assertEqual(cov_st, 0)
+ self.assertEqual(cov_st, 1)
self.assertIn("in excepthook", py_out)
self.assertEqual(cov_out, py_out)