summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-07-04 08:20:11 -0400
committerNed Batchelder <ned@nedbatchelder.com>2016-07-04 08:20:11 -0400
commit98539b47a2790255f633260bcd60243dc7b6647c (patch)
treebb1b2bf11f0a547fda96c8cfb386da953ae7238c /coverage/control.py
parent1fc4c9681034a2123ce27fa336d16df5dc1cee9c (diff)
downloadpython-coveragepy-git-98539b47a2790255f633260bcd60243dc7b6647c.tar.gz
Let the concurrency option be multi-valued. #484
Diffstat (limited to 'coverage/control.py')
-rw-r--r--coverage/control.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/coverage/control.py b/coverage/control.py
index 9bd0def1..41239be0 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -110,12 +110,16 @@ class Coverage(object):
`concurrency` is a string indicating the concurrency library being used
in the measured code. Without this, coverage.py will get incorrect
- results. Valid strings are "greenlet", "eventlet", "gevent",
- "multiprocessing", or "thread" (the default).
+ results if these libraries are in use. Valid strings are "greenlet",
+ "eventlet", "gevent", "multiprocessing", or "thread" (the default).
+ This can also be a list of these strings.
.. versionadded:: 4.0
The `concurrency` parameter.
+ .. versionadded:: 4.2
+ The `concurrency` parameter can now be a list of strings.
+
"""
# Build our configuration from a number of sources:
# 1: defaults:
@@ -244,10 +248,10 @@ class Coverage(object):
self.omit = prep_patterns(self.config.omit)
self.include = prep_patterns(self.config.include)
- concurrency = self.config.concurrency
- if concurrency == "multiprocessing":
+ concurrency = self.config.concurrency or []
+ if "multiprocessing" in concurrency:
patch_multiprocessing()
- concurrency = None
+ #concurrency = None
# Multi-processing uses parallel for the subprocesses, so also use
# it for the main process.
self.config.parallel = True