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
I have so far been using Python code to configure warning filters (rather than $PYTHONWARNINGS, -W, or filterwarnings in pytest.ini) because this enables me to use regular expression to select modules.
My use case is that I would like to see all Deprecation warnings that can be fixed in the application that I'm testing, but not in modules that I do not control. With regular expressions, I can just match on the top-level module name. Without regular expression, I need to hardcode every module and sub-module.
Unfortunately, I have just discovered that pytest has been messing with my warning configuration despite me using the -p no:warnings flag (see #10847 for a related problem).
Is there any way to use pytest's own warnings facilities with regular expressions for the module?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have so far been using Python code to configure warning filters (rather than
$PYTHONWARNINGS
,-W
, orfilterwarnings
in pytest.ini) because this enables me to use regular expression to select modules.My use case is that I would like to see all Deprecation warnings that can be fixed in the application that I'm testing, but not in modules that I do not control. With regular expressions, I can just match on the top-level module name. Without regular expression, I need to hardcode every module and sub-module.
Unfortunately, I have just discovered that pytest has been messing with my warning configuration despite me using the
-p no:warnings
flag (see #10847 for a related problem).Is there any way to use pytest's own warnings facilities with regular expressions for the module?
Beta Was this translation helpful? Give feedback.
All reactions