numpy.testing.assert_warns

numpy.testing.assert_warns(warning_class, func, *args, **kw)

Fail unless a warning of class warning_class is thrown by callable when invoked with arguments args and keyword arguments kwargs.

If a different type of warning is thrown, it will not be caught, and the test case will be deemed to have suffered an error.

Previous topic

numpy.testing.assert_raises

Next topic

numpy.testing.assert_string_equal

This Page