summaryrefslogtreecommitdiff
path: root/tests/test_debug.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-09-24 19:08:50 -0400
committerNed Batchelder <ned@nedbatchelder.com>2016-09-24 19:08:50 -0400
commit0c642aea0842b72868293b2e9bbb34ed2aecb6ff (patch)
tree452c2ac40687757afa2f83553d274b4da47ee6fa /tests/test_debug.py
parent798c38e9f6d6598dc59ea6f5d71fce96cdeb7ae7 (diff)
downloadpython-coveragepy-git-0c642aea0842b72868293b2e9bbb34ed2aecb6ff.tar.gz
Clean up and test the callers debugging info
Diffstat (limited to 'tests/test_debug.py')
-rw-r--r--tests/test_debug.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_debug.py b/tests/test_debug.py
index 8309395b..e80beecf 100644
--- a/tests/test_debug.py
+++ b/tests/test_debug.py
@@ -103,6 +103,19 @@ class DebugTraceTest(CoverageTest):
self.assertTrue(lines_matching(out_lines, pid_prefix + "Tracing "))
self.assertTrue(lines_matching(out_lines, pid_prefix + "Not tracing "))
+ def test_debug_trace_callers(self):
+ out_lines = self.f1_debug_output(["trace", "callers"])
+
+ # For every "Tracing" or "Not tracing" message, there should be a stack
+ # trace with a line like "_should_trace : /Users/ned/coverage/control.py @616"
+ trace_messages = lines_matching(out_lines, r"^(T|Not t)racing ")
+ should_trace_pattern = r"\s+_should_trace : .*coverage[/\\]control.py @\d+$"
+ should_trace_frames = lines_matching(out_lines, should_trace_pattern)
+ self.assertEqual(len(trace_messages), len(should_trace_frames))
+
+ # The very last line should be a _should_trace frame.
+ self.assertRegex(out_lines[-1], should_trace_pattern)
+
def test_debug_config(self):
out_lines = self.f1_debug_output(["config"])