diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2018-10-19 06:16:56 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2018-10-19 07:05:46 -0400 |
commit | e08528bb01063c7b6db60b9c7c2516615b818303 (patch) | |
tree | 4ca83c87effc9f703a976e993c42ddfa2e45388e /tests/test_cmdline.py | |
parent | f0414651b855de1f2d834a3c3a99d56b6c2a0753 (diff) | |
download | python-coveragepy-git-e08528bb01063c7b6db60b9c7c2516615b818303.tar.gz |
One more error case for the command line
Diffstat (limited to 'tests/test_cmdline.py')
-rw-r--r-- | tests/test_cmdline.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py index e7d3fafa..ff035764 100644 --- a/tests/test_cmdline.py +++ b/tests/test_cmdline.py @@ -540,7 +540,6 @@ class CmdLineTest(BaseCmdLineTest): ) def test_run_module_from_config(self): - options = {"run:command_line": "-m mymodule thing1 thing2"} self.cmd_executes("run", """\ .Coverage() .start() @@ -548,7 +547,7 @@ class CmdLineTest(BaseCmdLineTest): .stop() .save() """, - options=options, + options={"run:command_line": "-m mymodule thing1 thing2"}, ) def test_run_from_config_but_empty(self): @@ -556,10 +555,25 @@ class CmdLineTest(BaseCmdLineTest): .Coverage() .help_fn('Nothing to do.') """, - ret=1, + ret=ERR, options={"run:command_line": ""}, ) + def test_run_dashm_only(self): + self.cmd_executes("run -m", """\ + .Coverage() + .help_fn('No module specified for -m') + """, + ret=ERR, + ) + self.cmd_executes("run -m", """\ + .Coverage() + .help_fn('No module specified for -m') + """, + ret=ERR, + options={"run:command_line": "myprog.py"} + ) + def test_cant_append_parallel(self): self.command_line("run --append --parallel-mode foo.py", ret=ERR) self.assertIn("Can't append to data files in parallel mode.", self.stderr()) |