Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(parser): Fix --discover parsed incorrectly from env #3274

Merged
merged 4 commits into from Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog/3272.bugfix.rst
@@ -0,0 +1 @@
Fix broken input parsing for ``--discover`` flag. - by :user:`mimre25`
1 change: 1 addition & 0 deletions docs/changelog/3274.doc.rst
@@ -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
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
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