-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
plugin: warningsrelated to the warnings builtin pluginrelated to the warnings builtin plugintype: docsdocumentation improvement, missing or needing clarificationdocumentation improvement, missing or needing clarification
Milestone
Description
We should add some stdlib links to the relevant docs:
- If you want to get a list of warnings, but no error if no warnings were emitted, use
warnings.catch_warnings()
- To say "any warning here is unexpected / an error", use
with catch_warnings(): simplefilter("error"); ...
I didn't intend to break anything, but nor did I consider that people might be using pytest.warns()
like warnings.catch_warnings()
. My apologies for the inconvenience!
Originally posted by @Zac-HD in #8677 (comment)
Zac-HD, djmattyg007 and WarrenWeckesser
Metadata
Metadata
Assignees
Labels
plugin: warningsrelated to the warnings builtin pluginrelated to the warnings builtin plugintype: docsdocumentation improvement, missing or needing clarificationdocumentation improvement, missing or needing clarification