Test support (numpy.testing) — NumPy v2.2 Manual (original) (raw)

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

Asserts#

It is recommended to use one of assert_allclose,assert_array_almost_equal_nulp or assert_array_max_ulp instead of these functions for more consistent floating point comparisons.

Decorators#

Test running#

Testing custom array containers (numpy.testing.overrides)#

These functions can be useful when testing custom array container implementations which make use of __array_ufunc__/__array_function__.

Guidelines#