summaryrefslogtreecommitdiff
path: root/tests/test_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 /tests/test_cmdline.py
parent616cca33b0fc9340a61a873970f47c8af37e5302 (diff)
downloadpython-coveragepy-git-00f842367a49bc9c0a486cabf0dd01dd36bc72aa.tar.gz
Fail command lines that use multiprocessing and other options together. #495
Diffstat (limited to 'tests/test_cmdline.py')
-rw-r--r--tests/test_cmdline.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py
index d72fd83c..f2531605 100644
--- a/tests/test_cmdline.py
+++ b/tests/test_cmdline.py
@@ -464,6 +464,16 @@ class CmdLineTest(BaseCmdLineTest):
out = self.stdout()
self.assertIn("option --concurrency: invalid choice: 'multiprocessing,gevent'", out)
+ def test_multiprocessing_needs_config_file(self):
+ # You can't use command-line args to add options to multiprocessing
+ # runs, since they won't make it to the subprocesses. You need to use a
+ # config file.
+ self.command_line("run --concurrency=multiprocessing --branch foo.py", ret=ERR)
+ self.assertIn(
+ "Options affecting multiprocessing must be specified in a configuration file.",
+ self.stdout()
+ )
+
def test_run_debug(self):
self.cmd_executes("run --debug=opt1 foo.py", """\
.coverage(debug=["opt1"])