summaryrefslogtreecommitdiff
path: root/tests/test_data.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_data.py')
-rw-r--r--tests/test_data.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/test_data.py b/tests/test_data.py
index 5e7b7fc4..59c4a5bb 100644
--- a/tests/test_data.py
+++ b/tests/test_data.py
@@ -604,26 +604,25 @@ class CoverageDataFilesTest(DataTestHelpers, CoverageTest):
self.assertTrue(all(str(os.getpid()) in fn for fn in data_files2))
def test_combining(self):
- self.assert_doesnt_exist(".coverage.1")
- self.assert_doesnt_exist(".coverage.2")
+ self.assert_file_count(".coverage.*", 0)
covdata1 = CoverageData()
covdata1.add_lines(LINES_1)
self.data_files.write(covdata1, suffix='1')
self.assert_exists(".coverage.1")
- self.assert_doesnt_exist(".coverage.2")
+ self.assert_file_count(".coverage.*", 1)
covdata2 = CoverageData()
covdata2.add_lines(LINES_2)
self.data_files.write(covdata2, suffix='2')
self.assert_exists(".coverage.2")
+ self.assert_file_count(".coverage.*", 2)
covdata3 = CoverageData()
self.data_files.combine_parallel_data(covdata3)
self.assert_line_counts(covdata3, SUMMARY_1_2)
self.assert_measured_files(covdata3, MEASURED_FILES_1_2)
- self.assert_doesnt_exist(".coverage.1")
- self.assert_doesnt_exist(".coverage.2")
+ self.assert_file_count(".coverage.*", 0)
def test_erasing(self):
covdata1 = CoverageData()
@@ -644,8 +643,7 @@ class CoverageDataFilesTest(DataTestHelpers, CoverageTest):
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_file_count("datafile.*", 0)
self.assert_exists(".coverage")
def read_json_data_file(self, fname):
@@ -719,11 +717,16 @@ class CoverageDataFilesTest(DataTestHelpers, CoverageTest):
})
self.data_files.write(covdata2, suffix='2')
+ self.assert_file_count(".coverage.*", 2)
+
covdata3 = CoverageData()
aliases = PathAliases()
aliases.add("/home/ned/proj/src/", "./")
aliases.add(r"c:\ned\test", "./")
self.data_files.combine_parallel_data(covdata3, aliases=aliases)
+ self.assert_file_count(".coverage.*", 0)
+ # covdata3 hasn't been written yet. Should this file exist or not?
+ #self.assert_exists(".coverage")
apy = canonical_filename('./a.py')
sub_bpy = canonical_filename('./sub/b.py')