Repository navigation
Raise UsageError for invalid tmp_path_retention_count - #15464
Open
RonnyPfannschmidt wants to merge 1 commit into
Open
RonnyPfannschmidt wants to merge 1 commit into
RonnyPfannschmidt wants to merge 1 commit into
Conversation
A non-numeric string (e.g. "banana" in TOML) hit int() and a negative count hit an explicit ValueError, both reported as internal error tracebacks. Raise UsageError naming the option instead, as Config.get_verbosity does for the verbosity options. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3 tasks done
R-zin
approved these changes
Nov 28, 2026
SemTiOne
approved these changes
Nov 29, 2026
Comment on lines
104
to
105
| # A str only gets here from TOML: in ini mode the int member of | ||
| # the option type already converted it. |
Contributor
There was a problem hiding this comment.
Nit: a string can also reach this branch from INI when the int member of the int | str union rejects it and the union falls back to str. Perhaps we could adjust the comment to reflect both cases?
Suggested change
| # A str only gets here from TOML: in ini mode the int member of | |
| # the option type already converted it. | |
| # Integer strings in TOML are accepted for backward compatibility. | |
| # Invalid strings from either config format are rejected below. |
This branch has not been deployed
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.
Requested by Ronny · project thread
🤖 Written by Claude Opus 5.5 via Claude Code for the pytest maintainers; I prompted it, it did the work, I read it.
Follow-up to #15296. A non-numeric
tmp_path_retention_count(e.g."banana"in TOML) and a negative count used to crash with a rawValueErrortraceback. They now raise aUsageErrorthat names the option, likeget_verbositydoes. There are new tests for both cases.Generated by Claude Code