summaryrefslogtreecommitdiff
path: root/tests/test_debug.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2019-07-07 07:40:24 -0400
committerNed Batchelder <ned@nedbatchelder.com>2019-07-07 13:39:13 -0400
commitdade9db58673d4f712ba5c50ed66d1c67a7e1d5d (patch)
tree1b88b3f99bd3348b566d01943439ccb72b4673ca /tests/test_debug.py
parent4b43eff1377e818db2c42521d98bf2a0973b1cb6 (diff)
downloadpython-coveragepy-git-dade9db58673d4f712ba5c50ed66d1c67a7e1d5d.tar.gz
Avoid useless or redundant db operations. Faster.
Moving operations into the "with self._connect" means less opening and closing of the database. Returning early if there is no data to write avoids writing empty contexts.
Diffstat (limited to 'tests/test_debug.py')
-rw-r--r--tests/test_debug.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/test_debug.py b/tests/test_debug.py
index 4eaba92e..351ef919 100644
--- a/tests/test_debug.py
+++ b/tests/test_debug.py
@@ -136,16 +136,18 @@ class DebugTraceTest(CoverageTest):
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.
last_line = out_lines.splitlines()[-1]
+
+ # The details of what to expect on the stack are empirical, and can change
+ # as the code changes. This test is here to ensure that the debug code
+ # continues working. It's ok to adjust these details over time.
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+$")
+ self.assertRegex(real_messages[-1], r"^\s*\d+\.\w{4}: Adding file tracers: 0 files")
+ self.assertRegex(last_line, r"\s+add_file_tracers : .*coverage[/\\]sqldata.py @\d+$")
def test_debug_config(self):
out_lines = self.f1_debug_output(["config"])