12
12
13
13
import coverage
14
14
from coverage .data import CoverageData
15
+ from coverage .sqldata import filename_suffix
15
16
16
17
from .embed import cleanup
17
18
@@ -51,6 +52,10 @@ def ensure_topdir_wrapper(self, *args, **kwargs):
51
52
return ensure_topdir_wrapper
52
53
53
54
55
+ def _data_suffix (name ):
56
+ return f'{ filename_suffix (True )} .{ name } '
57
+
58
+
54
59
class CovController :
55
60
"""Base class for different plugin implementations."""
56
61
@@ -230,13 +235,13 @@ def start(self):
230
235
self .cov = coverage .Coverage (
231
236
source = self .cov_source ,
232
237
branch = self .cov_branch ,
233
- data_suffix = True ,
238
+ data_suffix = _data_suffix ( 'c' ) ,
234
239
config_file = self .cov_config ,
235
240
)
236
241
self .combining_cov = coverage .Coverage (
237
242
source = self .cov_source ,
238
243
branch = self .cov_branch ,
239
- data_suffix = True ,
244
+ data_suffix = _data_suffix ( 'cc' ) ,
240
245
data_file = os .path .abspath (self .cov .config .data_file ), # noqa: PTH100
241
246
config_file = self .cov_config ,
242
247
)
@@ -274,7 +279,7 @@ def start(self):
274
279
self .cov = coverage .Coverage (
275
280
source = self .cov_source ,
276
281
branch = self .cov_branch ,
277
- data_suffix = True ,
282
+ data_suffix = _data_suffix ( 'm' ) ,
278
283
config_file = self .cov_config ,
279
284
)
280
285
self .cov ._warn_no_data = False
@@ -283,7 +288,7 @@ def start(self):
283
288
self .combining_cov = coverage .Coverage (
284
289
source = self .cov_source ,
285
290
branch = self .cov_branch ,
286
- data_suffix = True ,
291
+ data_suffix = _data_suffix ( 'mc' ) ,
287
292
data_file = os .path .abspath (self .cov .config .data_file ), # noqa: PTH100
288
293
config_file = self .cov_config ,
289
294
)
@@ -330,7 +335,7 @@ def testnodedown(self, node, error):
330
335
data .read_fileobj (StringIO (output ['cov_worker_data' ]))
331
336
cov .data .update (data )
332
337
else :
333
- data = CoverageData (no_disk = True )
338
+ data = CoverageData (no_disk = True , suffix = 'should-not-exist' )
334
339
data .loads (output ['cov_worker_data' ])
335
340
cov .get_data ().update (data )
336
341
cov .stop ()
@@ -381,7 +386,7 @@ def start(self):
381
386
self .cov = coverage .Coverage (
382
387
source = self .cov_source ,
383
388
branch = self .cov_branch ,
384
- data_suffix = True ,
389
+ data_suffix = _data_suffix ( f'w { self . nodeid } ' ) ,
385
390
config_file = self .cov_config ,
386
391
)
387
392
self .cov .start ()
0 commit comments