Skip to content

Commit c54dfbd

Browse files
authored
fix(parser): Fix --discover parsed incorrectly from env (#3274)
1 parent 809e10f commit c54dfbd

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

docs/changelog/3272.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix broken input parsing for ``--discover`` flag. - by :user:`mimre25`

docs/changelog/3274.doc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Rephrase ``--discover`` flag's description to avoid confusion between paths and executables. - by :user:`mimre25`

src/tox/config/cli/parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ def __call__(
232232
dest="discover",
233233
nargs="+",
234234
metavar="path",
235-
help="for Python discovery first try the Python executables under these paths",
235+
of_type=List[str],
236+
help="for Python discovery first try these Python executables",
236237
default=[],
237238
)
238239
list_deps = sub_parser.add_mutually_exclusive_group()

tests/config/cli/test_cli_env_var.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def test_env_var_exhaustive_parallel_values(
8484
monkeypatch.setenv("TOX_PARALLEL", "3")
8585
monkeypatch.setenv("TOX_PARALLEL_LIVE", "no")
8686
monkeypatch.setenv("TOX_OVERRIDE", "a=b;c=d")
87+
monkeypatch.setenv("TOX_DISCOVER", "/foo/bar;/bar/baz;/baz/foo")
8788

8889
options = get_options()
8990
assert vars(options.parsed) == {
@@ -93,7 +94,7 @@ def test_env_var_exhaustive_parallel_values(
9394
"default_runner": "virtualenv",
9495
"develop": False,
9596
"devenv_path": None,
96-
"discover": [],
97+
"discover": ["/foo/bar", "/bar/baz", "/baz/foo"],
9798
"env": CliEnv(["py37", "py36"]),
9899
"force_dep": [],
99100
"hash_seed": ANY,

0 commit comments

Comments
 (0)