Skip to content

Clarify docs on specifying multiple filters with pytest.mark.filterwarnings #12966

Open
@soxofaan

Description

@soxofaan

Specifying multiple filterwarnings filter in the correct order can be a bit confusing.

When using @pytest.mark.filterwarnings as decorator, one has to use the reverse order compared to stdlib's warnings.filterwarnings (because of the order that decorators are evaluated).
When using pytestmark (list of pytest.mark.filterwarnings marks), it's the other way around.

I think this deserves a bit of clarification in the docs

FYI: I'm actually already working on a PR for this

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: 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