diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2022-05-22 18:53:51 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-05-22 18:58:04 -0400 |
commit | e6df5b39be55c44205ea67811bb812e085599d5e (patch) | |
tree | b99a8b37aee50d5a60d4c5fdd37964de8ddb066d /tests | |
parent | d849b2581b1b1dd52a6261568b0954a41210dd5b (diff) | |
download | python-coveragepy-git-6.4.tar.gz |
fix: don't create a data file when just trying to read one. #13286.4
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_data.py | 7 | ||||
-rw-r--r-- | tests/test_summary.py | 1 | ||||
-rw-r--r-- | tests/test_xml.py | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_data.py b/tests/test_data.py index 9f9a92bd..3cb519ca 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -118,6 +118,13 @@ class CoverageDataTest(CoverageTest): def test_empty_data_is_false(self): covdata = DebugCoverageData() assert not covdata + self.assert_doesnt_exist(".coverage") + + def test_empty_data_is_false_when_read(self): + covdata = DebugCoverageData() + covdata.read() + assert not covdata + self.assert_doesnt_exist(".coverage") def test_line_data_is_true(self): covdata = DebugCoverageData() diff --git a/tests/test_summary.py b/tests/test_summary.py index 4bce80f6..d603062b 100644 --- a/tests/test_summary.py +++ b/tests/test_summary.py @@ -450,6 +450,7 @@ class SummaryTest(UsingModulesMixin, CoverageTest): cov.load() with pytest.raises(NoDataError, match="No data to report."): self.get_report(cov, skip_covered=True) + self.assert_doesnt_exist(".coverage") def test_report_skip_empty(self): self.make_file("main.py", """ diff --git a/tests/test_xml.py b/tests/test_xml.py index 1e94dfa2..fda11087 100644 --- a/tests/test_xml.py +++ b/tests/test_xml.py @@ -139,6 +139,7 @@ class XmlReportTest(XmlTestHelpers, CoverageTest): with pytest.raises(NoDataError, match="No data to report."): self.run_xml_report() self.assert_doesnt_exist("coverage.xml") + self.assert_doesnt_exist(".coverage") def test_no_source(self): # Written while investigating a bug, might as well keep it. |