You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
soxofaan
added a commit
to soxofaan/pytest
that referenced
this issue
Nov 15, 2024
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'swarnings.filterwarnings
(because of the order that decorators are evaluated).When using
pytestmark
(list ofpytest.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
The text was updated successfully, but these errors were encountered: