summaryrefslogtreecommitdiff
path: root/coverage/cmdline.py
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
commit00f842367a49bc9c0a486cabf0dd01dd36bc72aa (patch)
tree1aa4cbc523c0e53c56025d2943288f916c8e3705 /coverage/cmdline.py
parent616cca33b0fc9340a61a873970f47c8af37e5302 (diff)
downloadpython-coveragepy-git-00f842367a49bc9c0a486cabf0dd01dd36bc72aa.tar.gz
Fail command lines that use multiprocessing and other options together. #495
Diffstat (limited to 'coverage/cmdline.py')
-rw-r--r--coverage/cmdline.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py
index e5306407..20d35892 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()