Description
Maybe this is rather niche, or more of a usage query, but I think it has confused us a little bit. One conundrum we occasionally face in SciPy is that the heavily-used NumPy library sometimes decides to issue warnings for some function calls, but the same code paths can also have try/except
guards for various reasons.
So, when we try to proactively turn warnings into errors in filterwarnings
in our pytest.ini
, what we end up with is a case where a warning becomes invisible to our testsuite/CI testing, and we miss out on i.e., deprecation warnings by the very mechanism we are trying to use to discover them, because the try/except
block is triggered via pytest
and then handled gracefully by NumPy to end up in a warning-free scenario!
Do you think there's a valid feature request in here? Or should we just resign ourselves to i.e., a CI job that runs the testsuite with the "warnings->errors" disabled and then greps on the pytest
summary and errors out on non-zero warnings accounting?
Related: