Repository navigation
Conversation
Restore compatibility with pytest 9.1 for TOML verbosity options while keeping plugin-defined int | Literal unions strict. Add regression coverage for getini and get_verbosity with both integer and numeric string TOML values. Co-authored-by: Codex <noreply@openai.com>
Author
|
All checks are green on |
Member
|
Closing as ai slop this solves the wrong problem at the wrong place and removes a intentional tightening of the behavior |
Member
|
🤖 Written by Claude Opus 5.5 via Claude Code for the pytest maintainers; I prompted it, it did the work, I read it. Superseded by #15296. It fixes the regression where the option type is declared, not with a name list in the generic Generated by Claude Code |
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.
Summary
pytest 9.2.0's strict TOML union validation rejected numeric string values for the built-in verbosity settings, despite the changelog promising backward compatibility. This restores numeric string handling for:
verbosity_assertionsverbosity_subtestsverbosity_test_casesThe compatibility path is limited to these built-in options. Generic plugin unions such as
int | strandint | Literal["auto"]keep their existing strict TOML behavior.Tests
python -m pytest testing/test_config.py -q— 312 passed, 3 skipped, 1 xfailedruff check src/_pytest/config/__init__.py testing/test_config.pyruff format --check src/_pytest/config/__init__.py testing/test_config.pypython -m py_compile src/_pytest/config/__init__.py testing/test_config.pyAI usage
Codex assisted with investigation, implementation, and tests. The submitting human reviewed and understood the complete change, and will respond to review feedback.
Closes #15290.
AUTHORSin alphabetical order.