1212
1313import coverage
1414from coverage .data import CoverageData
15+ from coverage .sqldata import filename_suffix
1516
1617from .embed import cleanup
1718
@@ -51,6 +52,10 @@ def ensure_topdir_wrapper(self, *args, **kwargs):
5152 return ensure_topdir_wrapper
5253
5354
55+ def _data_suffix (name ):
56+ return f'{ filename_suffix (True )} .{ name } '
57+
58+
5459class CovController :
5560 """Base class for different plugin implementations."""
5661
@@ -230,13 +235,13 @@ def start(self):
230235 self .cov = coverage .Coverage (
231236 source = self .cov_source ,
232237 branch = self .cov_branch ,
233- data_suffix = True ,
238+ data_suffix = _data_suffix ( 'c' ) ,
234239 config_file = self .cov_config ,
235240 )
236241 self .combining_cov = coverage .Coverage (
237242 source = self .cov_source ,
238243 branch = self .cov_branch ,
239- data_suffix = True ,
244+ data_suffix = _data_suffix ( 'cc' ) ,
240245 data_file = os .path .abspath (self .cov .config .data_file ), # noqa: PTH100
241246 config_file = self .cov_config ,
242247 )
@@ -274,7 +279,7 @@ def start(self):
274279 self .cov = coverage .Coverage (
275280 source = self .cov_source ,
276281 branch = self .cov_branch ,
277- data_suffix = True ,
282+ data_suffix = _data_suffix ( 'm' ) ,
278283 config_file = self .cov_config ,
279284 )
280285 self .cov ._warn_no_data = False
@@ -283,7 +288,7 @@ def start(self):
283288 self .combining_cov = coverage .Coverage (
284289 source = self .cov_source ,
285290 branch = self .cov_branch ,
286- data_suffix = True ,
291+ data_suffix = _data_suffix ( 'mc' ) ,
287292 data_file = os .path .abspath (self .cov .config .data_file ), # noqa: PTH100
288293 config_file = self .cov_config ,
289294 )
@@ -330,7 +335,7 @@ def testnodedown(self, node, error):
330335 data .read_fileobj (StringIO (output ['cov_worker_data' ]))
331336 cov .data .update (data )
332337 else :
333- data = CoverageData (no_disk = True )
338+ data = CoverageData (no_disk = True , suffix = 'should-not-exist' )
334339 data .loads (output ['cov_worker_data' ])
335340 cov .get_data ().update (data )
336341 cov .stop ()
@@ -381,7 +386,7 @@ def start(self):
381386 self .cov = coverage .Coverage (
382387 source = self .cov_source ,
383388 branch = self .cov_branch ,
384- data_suffix = True ,
389+ data_suffix = _data_suffix ( f'w { self . nodeid } ' ) ,
385390 config_file = self .cov_config ,
386391 )
387392 self .cov .start ()
0 commit comments