test: normalize argparse choice snapshots#2000
Open
puneetdixit200 wants to merge 2 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2000 +/- ##
=======================================
Coverage 98.24% 98.24%
=======================================
Files 61 61
Lines 2785 2785
=======================================
Hits 2736 2736
Misses 49 49 ☔ View full report in Codecov by Sentry. |
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
Fixes #1990 by normalizing only the volatile argparse
(choose from ...)choice list before the invalid-command snapshot assertion. This lets theinvalidCommandparametrization run again on Python 3.14.5+, while keeping the command failure, usage output, and invalid value covered.Checklist
Was generative AI tooling used to co-author this PR?
Generated-by: OpenAI GPT-5 following the guidelines
Code Changes
uv run poe alllocally to ensure this change passes linter check and testsDocumentation Changes
No documentation changes.
uv run poe doclocally to ensure the documentation pages renders correctlyExpected Behavior
tests/test_cli.py::test_invalid_command[invalidCommand]should pass across Python patch releases that differ only in whether argparse quotes thechoose fromentries.Steps to Test This Pull Request
UV_CACHE_DIR=$PWD/.uv-cache UV_PROJECT_ENVIRONMENT=$PWD/.venv314 uv run --python python3.14 --group test pytest tests/test_cli.py::test_normalize_argparse_choice_quotes tests/test_cli.py::test_invalid_command -qUV_CACHE_DIR=$PWD/.uv-cache UV_PROJECT_ENVIRONMENT=$PWD/.venv314 uv run --python python3.14 ruff check tests/test_cli.pyUV_CACHE_DIR=$PWD/.uv-cache UV_PROJECT_ENVIRONMENT=$PWD/.venv314 uv run --python python3.14 ruff format --check tests/test_cli.pygit diff --checkAdditional Context
I did not run the full
uv run poe allsuite locally because this change is isolated totests/test_cli.pyand the targeted Python 3.14.5 regression plus ruff checks cover the changed behavior.