summaryrefslogtreecommitdiff
path: root/tests/test_debug.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-08-24 07:13:42 -0400
committerNed Batchelder <ned@nedbatchelder.com>2018-08-24 07:13:42 -0400
commitc4b2392dd51b7f976972afb00f01d4618c523cff (patch)
tree7c77b420d4eec7ac628393663c67c0e9bc2c66f7 /tests/test_debug.py
parent8a337f91e6444c027771741a56636a56389706e3 (diff)
parentdd5b0cc88ebe4528abaa7cdf0b3fd516fb1f7e01 (diff)
downloadpython-coveragepy-git-c4b2392dd51b7f976972afb00f01d4618c523cff.tar.gz
Merge branch 'nedbat/data-sqlite'
Diffstat (limited to 'tests/test_debug.py')
-rw-r--r--tests/test_debug.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/test_debug.py b/tests/test_debug.py
index 2699ca61..c47dd343 100644
--- a/tests/test_debug.py
+++ b/tests/test_debug.py
@@ -128,18 +128,23 @@ class DebugTraceTest(CoverageTest):
def test_debug_callers(self):
out_lines = self.f1_debug_output(["pid", "dataop", "dataio", "callers"])
print(out_lines)
- # For every real message, there should be a stack
- # trace with a line like "f1_debug_output : /Users/ned/coverage/tests/test_debug.py @71"
+ # For every real message, there should be a stack trace with a line like
+ # "f1_debug_output : /Users/ned/coverage/tests/test_debug.py @71"
real_messages = re_lines(out_lines, r" @\d+", match=False).splitlines()
frame_pattern = r"\s+f1_debug_output : .*tests[/\\]test_debug.py @\d+$"
frames = re_lines(out_lines, frame_pattern).splitlines()
self.assertEqual(len(real_messages), len(frames))
# The last message should be "Writing data", and the last frame should
- # be write_file in data.py.
- self.assertRegex(real_messages[-1], r"^\s*\d+\.\w{4}: Writing data")
+ # be _write_file in data.py.
last_line = out_lines.splitlines()[-1]
- self.assertRegex(last_line, r"\s+write_file : .*coverage[/\\]data.py @\d+$")
+ from coverage.data import STORAGE
+ if STORAGE == "json":
+ self.assertRegex(real_messages[-1], r"^\s*\d+\.\w{4}: Writing data")
+ self.assertRegex(last_line, r"\s+_write_file : .*coverage[/\\]data.py @\d+$")
+ else:
+ self.assertRegex(real_messages[-1], r"^\s*\d+\.\w{4}: Creating data file")
+ self.assertRegex(last_line, r"\s+_create_db : .*coverage[/\\]sqldata.py @\d+$")
def test_debug_config(self):
out_lines = self.f1_debug_output(["config"])