summaryrefslogtreecommitdiff
path: root/test/test_process.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-02-24 20:59:45 -0500
committerNed Batchelder <ned@nedbatchelder.com>2010-02-24 20:59:45 -0500
commita1798a6c744d58b65e6b045d823c7c66d125f214 (patch)
tree7658ea48b62526cd78c13b9020b48f94fc51d1db /test/test_process.py
parent2b638ec17b1be049a2050aca866d224b1b957630 (diff)
downloadpython-coveragepy-a1798a6c744d58b65e6b045d823c7c66d125f214.tar.gz
When emulating the Python interpreter, don't print SystemExits tracebacks.
Diffstat (limited to 'test/test_process.py')
-rw-r--r--test/test_process.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/test_process.py b/test/test_process.py
index 8e621ad..53dce06 100644
--- a/test/test_process.py
+++ b/test/test_process.py
@@ -170,3 +170,22 @@ class ProcessTest(CoverageTest):
self.assertTrue('File "throw.py", line 5, in f2' in out)
self.assertTrue('raise Exception("hey!")' in out)
self.assertFalse('coverage' in out)
+
+ def test_code_exits(self):
+ self.make_file("exit.py", """\
+ import sys
+ def f1():
+ print("about to exit..")
+ sys.exit(17)
+
+ def f2():
+ f1()
+
+ f2()
+ """)
+
+ # The important thing is for "coverage run" and "python" to report the
+ # same traceback.
+ out = self.run_command("coverage run exit.py")
+ out2 = self.run_command("python exit.py")
+ self.assertMultiLineEqual(out, out2)