From 00f842367a49bc9c0a486cabf0dd01dd36bc72aa Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 9 Jul 2016 12:36:02 -0400 Subject: Fail command lines that use multiprocessing and other options together. #495 --- coverage/cmdline.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'coverage/cmdline.py') 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() -- cgit v1.2.1