numpy.testing.clear_and_catch_warnings
- class numpy.testing.clear_and_catch_warnings(record=False, modules=())
Context manager that resets warning registry for catching warnings
Warnings can be slippery, because, whenever a warning is triggered, Python adds a
__warningregistry__member to the calling module. This makes it impossible to retrigger the warning in this module, whatever you put in the warnings filters. This context manager accepts a sequence of modules as a keyword argument to its constructor and:stores and removes any
entries in given on entry;