diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2019-12-17 07:19:31 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2019-12-17 07:37:31 -0500 |
commit | 842f5854e75362214ce4699d8707ccc81601900a (patch) | |
tree | 6824f02e884df38425c42cbcacc6535d08f647ae /coverage/control.py | |
parent | 3875113f0e8a8ec333b61000fbe038a2725903f4 (diff) | |
download | python-coveragepy-git-842f5854e75362214ce4699d8707ccc81601900a.tar.gz |
run --append --concurrency=multiprocessing didn't use a suffix for the main process. #880
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/coverage/control.py b/coverage/control.py index 1de0e28f..5194b5d6 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -252,6 +252,11 @@ class Coverage(object): # to. self._debug = DebugControl(self.config.debug, self._debug_file) + if "multiprocessing" in (self.config.concurrency or ()): + # Multi-processing uses parallel for the subprocesses, so also use + # it for the main process. + self.config.parallel = True + # _exclude_re is a dict that maps exclusion list names to compiled regexes. self._exclude_re = {} @@ -393,16 +398,13 @@ class Coverage(object): def _init_for_start(self): """Initialization for start()""" # Construct the collector. - concurrency = self.config.concurrency or [] + concurrency = self.config.concurrency or () if "multiprocessing" in concurrency: if not patch_multiprocessing: raise CoverageException( # pragma: only jython "multiprocessing is not supported on this Python" ) patch_multiprocessing(rcfile=self.config.config_file) - # Multi-processing uses parallel for the subprocesses, so also use - # it for the main process. - self.config.parallel = True dycon = self.config.dynamic_context if not dycon or dycon == "none": |