diff --git a/pytest_watcher/parse.py b/pytest_watcher/parse.py index 866b0a2..23961b4 100644 --- a/pytest_watcher/parse.py +++ b/pytest_watcher/parse.py @@ -15,6 +15,7 @@ def _parse_patterns(arg: str): Watch the for file changes and trigger the test runner (pytest).\n Additional arguments are passed directly to the test runner. """, + allow_abbrev=False, ) parser.add_argument("path", type=Path, help="The path to watch for file changes.") parser.add_argument( diff --git a/tests/test_parse_arguments.py b/tests/test_parse_arguments.py index a77a6e7..f02cc76 100644 --- a/tests/test_parse_arguments.py +++ b/tests/test_parse_arguments.py @@ -77,11 +77,15 @@ def test_ignore_patterns(args: List[str], ignore_patterns: List[str]): ([".", "--lf", "--nf", "-vv"], ["--lf", "--nf", "-vv"]), ([".", "--runner", "tox", "--lf", "--nf", "-vv"], ["--lf", "--nf", "-vv"]), ([".", "--lf", "--nf", "-vv", "--runner", "tox"], ["--lf", "--nf", "-vv"]), + ( + [".", "--ignore", "tests/test_watcher.py"], + ["--ignore", "tests/test_watcher.py"], + ), ], ) def test_runner_args(args: List[str], runner_args: List[str]): - _, runner_args = parse_arguments(args) - assert runner_args == runner_args + _, parsed_args = parse_arguments(args) + assert parsed_args == runner_args def test_version(capsys: pytest.CaptureFixture):