I want to ignore all the UserWarning in my dev environment so that they are not printed into my error log file.
I’ve read the documentation of warnings module, and tried something like:
import warnings
import the_module_that_warns
warnings.simplefilter("ignore", UserWarning)
But UserWarning still get printed, why’s that?
If the modules warns on it import, the way you do it is too late.
Instead, do
in order to tell the
warningsmodule what to ignore before the warning comes.