File: routines.testing.rst

package info (click to toggle)
numpy 1%3A2.3.3%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 85,944 kB
  • sloc: python: 255,476; asm: 232,483; ansic: 212,559; cpp: 157,437; f90: 1,575; sh: 845; fortran: 567; makefile: 427; sed: 139; xml: 109; java: 97; perl: 82; cs: 62; javascript: 53; objc: 33; lex: 13; yacc: 9
file content (91 lines) | stat: -rw-r--r-- 1,926 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
.. _routines.testing:
.. module:: numpy.testing

Test support
============

.. currentmodule:: 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 :ref:`test scripts
<development-environment>` can just import it and work right away. For
background, see the :ref:`testing-guidelines`


Asserts
-------
.. autosummary::
   :toctree: generated/

   assert_allclose
   assert_array_almost_equal_nulp
   assert_array_max_ulp
   assert_array_equal
   assert_array_less
   assert_equal
   assert_raises
   assert_raises_regex
   assert_warns
   assert_no_warnings
   assert_no_gc_cycles
   assert_string_equal

Asserts (not recommended)
-------------------------
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.

.. autosummary::
   :toctree: generated/

   assert_
   assert_almost_equal
   assert_approx_equal
   assert_array_almost_equal
   print_assert_equal

Decorators
----------
.. autosummary::
   :toctree: generated/

   decorate_methods

Test running
------------
.. autosummary::
   :toctree: generated/

   clear_and_catch_warnings
   measure
   rundocs
   suppress_warnings

.. module:: numpy.testing.overrides

Testing custom array containers (:mod:`numpy.testing.overrides`)
----------------------------------------------------------------

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

.. currentmodule:: numpy.testing.overrides

.. autosummary::
   :toctree: generated/

   allows_array_function_override
   allows_array_ufunc_override
   get_overridable_numpy_ufuncs
   get_overridable_numpy_array_functions


Guidelines
----------

.. toctree::

   testing