Repository navigation
Honor warning instance categories before validating category arguments - #9034
Conversation
Extract the Python 3.14-compatible ordering fix from RustPython#8954. An existing Warning instance determines its own category, regardless of the category argument. Keep canonical invalid-category coverage and add only the missing instance case to the existing warnings snippet. Assisted-by: OpenAI Codex:model identifier unavailable
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (2)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 88b67ee361
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| assert len(caught) == 1 | ||
| assert caught[0].message is message | ||
| assert caught[0].category is CustomWarning |
There was a problem hiding this comment.
Remove the new assertions from the test file
These lines add new assertions and test logic to an existing test file, but this repository explicitly prohibits modifying test assertions, logic, or data and limits acceptable test-file edits to adding or removing expected-failure markers; this test-file portion of the commit therefore needs to be removed or handled through an approved non-test-file mechanism.
AGENTS.md reference: AGENTS.md:L275-L279
Useful? React with 👍 / 👎.
When the warning message is already a
Warninginstance, use its class before validating the explicit category argument. This matches CPython 3.14 for valid, unrelated, and invalid category arguments.Extracted from #8954 without its Python 3.15 diagnostic change. Adds only the missing instance cases to the existing warnings snippet; canonical tests retain coverage for invalid categories with ordinary messages.
Validation:
AI-assisted implementation, tests, and review with OpenAI Codex. Kept as a draft for CI and maintainer review.