Skip to content

Commit 2fffc0f

Browse files
test: skip invalidCommand argparse fixture on Python 3.14.5+ (#1990)
Python 3.14.5 (released 2026-05-10) reverts the unquoted `choose from` format in argparse error messages via CPython gh-130750. The checked-in fixture `test_invalid_command_py_3_14_invalidCommand_.txt` was generated against 3.14.0-3.14.4 (unquoted), so the test fails when CI picks up 3.14.5. Skip only the affected `arg=invalidCommand` parametrization on 3.14.5+ via `pytest.param(..., marks=pytest.mark.skipif(...))`; `arg=--invalid-arg` is unaffected (its fixture is the "required arguments" error which uses the metavar, not the choice list). Tracking a more durable normalization-based fix in #1990. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4d99415 commit 2fffc0f

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

tests/test_cli.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,17 @@ def test_no_argv(util: UtilFixture, capsys, file_regression):
3131
"arg",
3232
[
3333
"--invalid-arg",
34-
"invalidCommand",
34+
pytest.param(
35+
"invalidCommand",
36+
marks=pytest.mark.skipif(
37+
(3, 14, 5) <= sys.version_info < (3, 15),
38+
reason=(
39+
"Python 3.14.5 restored argparse choice quoting (CPython "
40+
"gh-130750); the checked-in fixture matches the 3.14.0-4 "
41+
"unquoted format. See #1990."
42+
),
43+
),
44+
),
3545
],
3646
)
3747
@pytest.mark.usefixtures("python_version", "consistent_terminal_output")

0 commit comments

Comments
 (0)