Skip to content

Commit

Permalink
fix(parser): Fix --discover parsed incorrectly from env (#3274)
Browse files Browse the repository at this point in the history
  • Loading branch information
mimre25 authored Apr 26, 2024
1 parent 809e10f commit c54dfbd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/changelog/3272.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix broken input parsing for ``--discover`` flag. - by :user:`mimre25`
1 change: 1 addition & 0 deletions docs/changelog/3274.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rephrase ``--discover`` flag's description to avoid confusion between paths and executables. - by :user:`mimre25`
3 changes: 2 additions & 1 deletion src/tox/config/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ def __call__(
dest="discover",
nargs="+",
metavar="path",
help="for Python discovery first try the Python executables under these paths",
of_type=List[str],
help="for Python discovery first try these Python executables",
default=[],
)
list_deps = sub_parser.add_mutually_exclusive_group()
Expand Down
3 changes: 2 additions & 1 deletion tests/config/cli/test_cli_env_var.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def test_env_var_exhaustive_parallel_values(
monkeypatch.setenv("TOX_PARALLEL", "3")
monkeypatch.setenv("TOX_PARALLEL_LIVE", "no")
monkeypatch.setenv("TOX_OVERRIDE", "a=b;c=d")
monkeypatch.setenv("TOX_DISCOVER", "/foo/bar;/bar/baz;/baz/foo")

options = get_options()
assert vars(options.parsed) == {
Expand All @@ -93,7 +94,7 @@ def test_env_var_exhaustive_parallel_values(
"default_runner": "virtualenv",
"develop": False,
"devenv_path": None,
"discover": [],
"discover": ["/foo/bar", "/bar/baz", "/baz/foo"],
"env": CliEnv(["py37", "py36"]),
"force_dep": [],
"hash_seed": ANY,
Expand Down

0 comments on commit c54dfbd

Please sign in to comment.