summaryrefslogtreecommitdiff
path: root/coverage
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-07-09 12:36:02 -0400
committerNed Batchelder <ned@nedbatchelder.com>2016-07-09 12:36:02 -0400
commitf471a289d9677daf8978b15997bd1667e8681661 (patch)
treeeadceef8944689c41ece91b4d3581190b6ccd3bf /coverage
parenta87bfb11160fc30eebaa08375ff263a503c8887d (diff)
downloadpython-coveragepy-f471a289d9677daf8978b15997bd1667e8681661.tar.gz
Fail command lines that use multiprocessing and other options together. #495
Diffstat (limited to 'coverage')
-rw-r--r--coverage/cmdline.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py
index e530640..20d3589 100644
--- a/coverage/cmdline.py
+++ b/coverage/cmdline.py
@@ -602,6 +602,17 @@ class CoverageScript(object):
self.help_fn("Can't append to data files in parallel mode.")
return ERR
+ if options.concurrency == "multiprocessing":
+ # Can't set other run-affecting command line options with
+ # multiprocessing.
+ for opt_name in ['branch', 'include', 'omit', 'pylib', 'source', 'timid']:
+ if getattr(options, opt_name) != getattr(Opts, opt_name).default:
+ self.help_fn(
+ "Options affecting multiprocessing must be specified "
+ "in a configuration file."
+ )
+ return ERR
+
if not self.coverage.get_option("run:parallel"):
if not options.append:
self.coverage.erase()