File tree 3 files changed +28
-1
lines changed
3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -37,13 +37,18 @@ Unreleased
37
37
- API: The exceptions raised by Coverage.py have been specialized, to provide
38
38
finer-grained catching of exceptions by third-party code.
39
39
40
+ - API: Using ``suffix=False `` when constructing a Coverage object with
41
+ multiprocessing wouldn't suppress the data file suffix (`issue 989 `_). This
42
+ is now fixed.
43
+
40
44
- Debug: The `coverage debug data ` command will now sniff out combinable data
41
45
files, and report on all of them.
42
46
43
47
- Debug: The `coverage debug ` command used to accept a number of topics at a
44
48
time, and show all of them, though this was never documented. This no longer
45
49
works, to allow for command-line options in the future.
46
50
51
+ .. _issue 989 : https://github.com/nedbat/coveragepy/issues/989
47
52
.. _issue 1203 : https://github.com/nedbat/coveragepy/issues/1203
48
53
49
54
Original file line number Diff line number Diff line change @@ -482,10 +482,15 @@ def _init_for_start(self):
482
482
)
483
483
484
484
suffix = self ._data_suffix_specified
485
- if suffix or self . config . parallel :
485
+ if suffix :
486
486
if not isinstance (suffix , str ):
487
487
# if data_suffix=True, use .machinename.pid.random
488
488
suffix = True
489
+ elif self .config .parallel :
490
+ if suffix is None :
491
+ suffix = True
492
+ elif not isinstance (suffix , str ):
493
+ suffix = bool (suffix )
489
494
else :
490
495
suffix = None
491
496
Original file line number Diff line number Diff line change @@ -1199,3 +1199,20 @@ def test_combine_relative(self):
1199
1199
assert files == {'foo.py' , 'bar.py' , os_sep ('modsrc/__init__.py' )}
1200
1200
res = cov .report ()
1201
1201
assert res == 100
1202
+
1203
+ def test_combine_no_suffix_multiprocessing (self ):
1204
+ self .make_file (".coveragerc" , """\
1205
+ [run]
1206
+ branch = True
1207
+ """ )
1208
+ cov = coverage .Coverage (
1209
+ config_file = ".coveragerc" ,
1210
+ concurrency = "multiprocessing" ,
1211
+ data_suffix = False ,
1212
+ )
1213
+ cov .start ()
1214
+ cov .stop ()
1215
+ cov .combine ()
1216
+ cov .save ()
1217
+ self .assert_file_count (".coverage.*" , 0 )
1218
+ self .assert_exists (".coverage" )
You can’t perform that action at this time.
0 commit comments