diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_data.py | 10 | ||||
-rw-r--r-- | tests/test_process.py | 17 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_data.py b/tests/test_data.py index ec163950..b370aa21 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -574,6 +574,16 @@ class CoverageDataFilesTest(DataTestHelpers, CoverageTest): self.data_files.read(covdata2) self.assert_line_counts(covdata2, {}) + def test_erasing_parallel(self): + self.make_file("datafile.1") + self.make_file("datafile.2") + self.make_file(".coverage") + data_files = CoverageDataFiles("datafile") + data_files.erase(parallel=True) + self.assert_doesnt_exist("datafile.1") + self.assert_doesnt_exist("datafile.2") + self.assert_exists(".coverage") + def read_json_data_file(self, fname): """Read a JSON data file for testing the JSON directly.""" with open(fname, 'r') as fdata: diff --git a/tests/test_process.py b/tests/test_process.py index 78d02bc1..7c8b0c2d 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -259,6 +259,23 @@ class ProcessTest(CoverageTest): self.assertEqual(actual, expected) self.assertEqual(list(summary.values())[0], 6) + def test_erase_parallel(self): + self.make_file(".coveragerc", """\ + [run] + data_file = data.dat + parallel = True + """) + self.make_file("data.dat") + self.make_file("data.dat.fooey") + self.make_file("data.dat.gooey") + self.make_file(".coverage") + + self.run_command("coverage erase") + self.assert_doesnt_exist("data.dat") + self.assert_doesnt_exist("data.dat.fooey") + self.assert_doesnt_exist("data.dat.gooey") + self.assert_exists(".coverage") + def test_missing_source_file(self): # Check what happens if the source is missing when reporting happens. self.make_file("fleeting.py", """\ |