From 2fffc0fcd9e7fd5d18972b44e8a8d24a889ca267 Mon Sep 17 00:00:00 2001 From: Tim Hsiung <26526132+bearomorphism@users.noreply.github.com> Date: Mon, 11 May 2026 11:58:35 +0800 Subject: [PATCH] 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> --- tests/test_cli.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index c1f6d5bed..492bfd59f 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -31,7 +31,17 @@ def test_no_argv(util: UtilFixture, capsys, file_regression): "arg", [ "--invalid-arg", - "invalidCommand", + pytest.param( + "invalidCommand", + marks=pytest.mark.skipif( + (3, 14, 5) <= sys.version_info < (3, 15), + reason=( + "Python 3.14.5 restored argparse choice quoting (CPython " + "gh-130750); the checked-in fixture matches the 3.14.0-4 " + "unquoted format. See #1990." + ), + ), + ), ], ) @pytest.mark.usefixtures("python_version", "consistent_terminal_output")