test: skip invalidCommand argparse fixture on Python 3.14.5+#1991
Merged
Conversation
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 task
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1991 +/- ##
=======================================
Coverage 98.23% 98.23%
=======================================
Files 61 61
Lines 2779 2779
=======================================
Hits 2730 2730
Misses 49 49 ☔ View full report in Codecov by Sentry. |
Lee-W
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Partially addresses #1990 — short-term skip only; the longer-term normalization fix (option C in the issue) is still tracked there.
Python 3.14.5 (released 2026-05-10) reverts the unquoted
choose fromformat in argparse error messages via CPython gh-130750:The checked-in fixture
tests/test_cli/test_invalid_command_py_3_14_invalidCommand_.txtwas generated against 3.14.0-3.14.4 (unquoted), sotest_invalid_command[py_3.14-invalidCommand]fails as soon as the GitHub-hosted runner upgrades to 3.14.5. Master's last successful CI run was on 2026-05-09 (commit1eb8cde6) on 3.14.4; runs on or after 2026-05-11 fail.This PR skips only the affected parametrization on 3.14.5+ via
pytest.param(..., marks=pytest.mark.skipif(...)). The companionarg='--invalid-arg'case is unaffected (its fixture is thethe following arguments are required:error, which uses the metavar, not the choice list).The longer-term normalization-based fix is intentionally left as a follow-up under #1990 so this PR stays narrowly scoped to unblocking CI.
Checklist
Was generative AI tooling used to co-author this PR?
Generated-by: GitHub Copilot CLI following the guidelines
Code Changes
uv run poe alllocally to ensure this change passes linter check and testsarg='invalidCommand'is skipped,arg='--invalid-arg'continues to run)(3, 14, 5) <= sys.version_info < (3, 15), so 3.14.4 and 3.15+ are unaffected)uv run pytest tests/test_cli.py::test_invalid_command -von Python 3.14.4 — both parametrizations pass; Python 3.14.5 binary not yet available via uv on Windows, but CI runners will exercise it)Documentation Changes
N/A.
Expected Behavior
On Python 3.14.5+,
test_invalid_command[py_3.14-invalidCommand]is skipped with a clear reason pointing at #1990 and CPython gh-130750. On all other Python versions, behavior is unchanged. #1990 stays open for the normalization-based follow-up.Steps to Test This Pull Request
uv run pytest tests/test_cli.py::test_invalid_command -von Python >= 3.14.5 — theinvalidCommandcase is skipped,--invalid-argpasses.Additional Context
CPython issue: python/cpython#130750
Python 3.14.5 changelog: https://docs.python.org/3.14/whatsnew/changelog.html#python-3-14-5-final
Surfaced while working on #1846.