-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
I'm really happy about pytest 3.8 and the work in #2908.
And now that I'm seeing warnings again, I realize how blissful ignorance is.
So I've gone through one project and fixed all of the deprecation warnings for the project under test (there are still many coming from other projects). In order to assert that the project no longer has any warnings, I added this to pytest.ini:
filterwarnings =
error:::mylib[.*]
Now tests pass, but all of the deprecation warnings (from the dependencies) are suppressed. That wasn't what I'd intended by setting the project to error on warnings.
I don't think that's the right behavior. Instead, pytest should configure the filters for DeprecationWarnings and PendingDeprecationWarnings and then allow the user to override those filters but not suppress the defaults with any value.
If the project must suppress the defaults, the docs should at least describe what the defaults are so they can be copied into the configuration wishing to define other filters. I had to traverse to the source to determine what the defaults are:
filterwarnings =
always::DeprecationWarning
always::PendingDeprecationWarning
Is there any reason not to always configure the defaults and allow overrides?