Skip to content

Mention that warning filter categories are not escaped #4255

@nicoddemus

Description

@nicoddemus

We should at least mention in the docs that we don't regex-escape the module names for warning filtering, as mentioned in @nedbat's post in his blog: https://nedbatchelder.com/blog/201810/why_warnings_is_mysterious.html

In my case, I was trying to suppress warnings reported while running tests with pytest. Pytest has its own setting for warnings filters, and it uses its own copy of the warnings.py code for reading them, so that the regexes are not escaped! This is very useful, but could also add to the mystery, since the pytest docs don’t mention the difference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributorplugin: warningsrelated to the warnings builtin plugintype: docsdocumentation improvement, missing or needing clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions