numpy.testing
Common test support for all numpy test scripts.
This single module should provide all the common functionality for numpy tests in a single location, so that test scripts can just import it and work right away. For background, see the Testing Guidelines
assert_almost_equal(actual, desired[, …])
assert_almost_equal
Raises an AssertionError if two items are not equal up to desired precision.
assert_approx_equal(actual, desired[, …])
assert_approx_equal
Raises an AssertionError if two items are not equal up to significant digits.
assert_array_almost_equal(x, y[, decimal, …])
assert_array_almost_equal
Raises an AssertionError if two objects are not equal up to desired precision.
assert_allclose(actual, desired[, rtol, …])
assert_allclose
Raises an AssertionError if two objects are not equal up to desired tolerance.
assert_array_almost_equal_nulp(x, y[, nulp])
assert_array_almost_equal_nulp
Compare two arrays relatively to their spacing.
assert_array_max_ulp(a, b[, maxulp, dtype])
assert_array_max_ulp
Check that all items of arrays differ in at most N Units in the Last Place.
assert_array_equal(x, y[, err_msg, verbose])
assert_array_equal
Raises an AssertionError if two array_like objects are not equal.
assert_array_less(x, y[, err_msg, verbose])
assert_array_less
Raises an AssertionError if two array_like objects are not ordered by less than.
assert_equal(actual, desired[, err_msg, verbose])
assert_equal
Raises an AssertionError if two objects are not equal.
assert_raises(exception_class, callable, …)
assert_raises
Fail unless an exception of class exception_class is thrown by callable when invoked with arguments args and keyword arguments kwargs.
assert_raises_regex(exception_class, …)
assert_raises_regex
Fail unless an exception of class exception_class and with message that matches expected_regexp is thrown by callable when invoked with arguments args and keyword arguments kwargs.
assert_warns(warning_class, *args, **kwargs)
assert_warns
Fail unless the given callable throws the specified warning.
assert_string_equal(actual, desired)
assert_string_equal
Test if two strings are equal.
dec.deprecated([conditional])
dec.deprecated
Filter deprecation warnings while running the test suite.
dec.knownfailureif(fail_condition[, msg])
dec.knownfailureif
Make function raise KnownFailureException exception if given condition is true.
dec.setastest([tf])
dec.setastest
Signals to nose that this function is or is not a test.
dec.skipif(skip_condition[, msg])
dec.skipif
Make function raise SkipTest exception if a given condition is true.
dec.slow(t)
dec.slow
Label a test as ‘slow’.
decorate_methods(cls, decorator[, testmatch])
decorate_methods
Apply a decorator to all methods in a class matching a regular expression.
Tester
alias of numpy.testing._private.nosetester.NoseTester
numpy.testing._private.nosetester.NoseTester
run_module_suite([file_to_run, argv])
run_module_suite
Run a test module.
rundocs([filename, raise_on_error])
rundocs
Run doctests found in the given file.
suppress_warnings([forwarding_rule])
suppress_warnings
Context manager and decorator doing much the same as warnings.catch_warnings.
warnings.catch_warnings
tests/
__init__.py
setup.py
numpy.test