From 2decea5db90895bc8ef8c8f2dd03ead3ecf2e221 Mon Sep 17 00:00:00 2001 From: Pavel Tsialnou <40162322+paveltsialnou@users.noreply.github.com> Date: Sat, 7 Aug 2021 00:45:25 +0300 Subject: Fix parsing 'command_line' option (#1201) Coverage config files supports 'command_line' parameters. However, only '-m' is parsed properly. The line 'command_line = "--module unittest discover"' is considered as a path, not a module option. --- coverage/cmdline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coverage/cmdline.py b/coverage/cmdline.py index 14921145..1fa52a97 100644 --- a/coverage/cmdline.py +++ b/coverage/cmdline.py @@ -710,7 +710,7 @@ class CoverageScript: command_line = self.coverage.get_option("run:command_line") if command_line is not None: args = shlex.split(command_line) - if args and args[0] == "-m": + if args and args[0] in {"-m", "--module"}: options.module = True args = args[1:] if not args: -- cgit v1.2.1