Skip to content

test: skip invalidCommand argparse fixture on Python 3.14.5+ - #1991

Merged
Lee-W merged 1 commit into
masterfrom
fix/1990-skip-3145-argparse-fixture
May 11, 2026
Merged

test: skip invalidCommand argparse fixture on Python 3.14.5+#1991
Lee-W merged 1 commit into
masterfrom
fix/1990-skip-3145-argparse-fixture

Conversation

@bearomorphism

@bearomorphismbearomorphism commented May 11, 2026

Copy link
Copy Markdown
Collaborator

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 from format in argparse error messages via CPython gh-130750:

Restore quoting of choices in argparse error messages for improved clarity and consistency with documentation.

The checked-in fixture tests/test_cli/test_invalid_command_py_3_14_invalidCommand_.txt was generated against 3.14.0-3.14.4 (unquoted), so test_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 (commit 1eb8cde6) 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 companion arg='--invalid-arg' case is unaffected (its fixture is the the 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?

  • Yes (please specify the tool below)

Generated-by: GitHub Copilot CLI following the guidelines

Code Changes

  • Add test cases to all the changes you introduce
  • Run uv run poe all locally to ensure this change passes linter check and tests
  • Manually test the changes:
    • Verify the feature/bug fix works as expected in real-world scenarios (skip activates on Python 3.14.5+; arg='invalidCommand' is skipped, arg='--invalid-arg' continues to run)
    • Test edge cases and error conditions (predicate is (3, 14, 5) <= sys.version_info < (3, 15), so 3.14.4 and 3.15+ are unaffected)
    • Ensure backward compatibility is maintained
    • Document any manual testing steps performed (ran uv run pytest tests/test_cli.py::test_invalid_command -v on 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

  1. Run uv run pytest tests/test_cli.py::test_invalid_command -v on Python >= 3.14.5 — the invalidCommand case is skipped, --invalid-arg passes.
  2. Run the same on Python 3.14.4 (or earlier 3.14.x) — both parametrizations pass.

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.

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>
@codecov

codecovBot commented May 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.23%. Comparing base (4b93a50) to head (2fffc0f).
⚠️ Report is 3 commits behind head on master.
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

@Lee-W
Lee-W merged commit 8e9af1e into masterMay 11, 2026
20 checks passed
@Lee-W
Lee-W deleted the fix/1990-skip-3145-argparse-fixture branch May 11, 2026 13:40
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@bearomorphism@Lee-W