diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_api.py | 15 | ||||
-rw-r--r-- | tests/test_debug.py | 10 |
2 files changed, 6 insertions, 19 deletions
diff --git a/tests/test_api.py b/tests/test_api.py index 920cd9ad..301257dc 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -326,21 +326,6 @@ class ApiTest(CoverageTest): with self.assert_warnings(cov, []): cov.get_data() - def test_two_getdata_only_warn_once_nostop(self): - self.make_code1_code2() - cov = coverage.Coverage(source=["."], omit=["code1.py"]) - cov.start() - import_local_file("code1") # pragma: nested - # We didn't collect any data, so we should get a warning. - with self.assert_warnings(cov, ["No data was collected"]): # pragma: nested - cov.get_data() # pragma: nested - # But calling get_data a second time with no intervening activity - # won't make another warning. - with self.assert_warnings(cov, []): # pragma: nested - cov.get_data() # pragma: nested - # Then stop it, or the test suite gets out of whack. - cov.stop() # pragma: nested - def test_two_getdata_warn_twice(self): self.make_code1_code2() cov = coverage.Coverage(source=["."], omit=["code1.py", "code2.py"]) 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"]) |