-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: Cannot filter DeprecationWarning from numpy.product() by caller module #24015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The This may also hide the warning from end-users at least in some cases. |
@seberg I think this can be closed as fixed in 2.0. |
Pushed off to 2.0.0. @seberg Can this be closed? |
Technically, still there. |
Describe the issue:
It seems that DeprecationWarning from
numpy.product
cannot be filtered by caller module. I set filterwarnings option for pytest asignore:<msg>:DeprecationWarning,error:<msg>:DeprecationWarning:mylib
but calls fromnumpy.product
inmylib
module is not treated as errors.After changing
stacklevel
argument ofwarnings.warn
called innumpy.core.fromnumeric._product_dispatcher
from 3 to 2, the filter started to work as I expected.Is this intended behavior?
Reproduce the code example:
Error message:
Runtime information:
Context for the issue:
Since numpy.product has begun emitting DeprecationWarning recently, I want pytest to ignore DeprecationWarnings if they are from 3rd party library and treat them as errors if they are from my library.
The text was updated successfully, but these errors were encountered: