numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
test(self, label='fast', verbose=1, extra_argv=None, doctests=False, coverage=False, raise_warnings=None, timer=False)

Notes

Each NumPy module exposes test in its namespace to run all tests for it. For example, to run all tests for numpy.lib:

>>> np.lib.test() #doctest: +SKIP

Parameters

label : {'fast', 'full', '', attribute identifier}, optional

Identifies the tests to run. This can be a string to pass to the nosetests executable with the '-A' option, or one of several special values. Special values are:

  • 'fast' - the default - which corresponds to the nosetests -A option of 'not slow'.

  • 'full' - fast (as above) and slow tests as in the 'no -A' option to nosetests - this is the same as ''.

  • None or '' - run all tests.

  • attribute_identifier - string passed directly to nosetests as '-A'.

verbose : int, optional

Verbosity value for test outputs, in the range 1-10. Default is 1.

extra_argv : list, optional

List with any extra arguments to pass to nosetests.

doctests : bool, optional

If True, run doctests in module. Default is False.

coverage : bool, optional

If True, report coverage of NumPy code. Default is False. (This requires the coverage module).

raise_warnings : None, str or sequence of warnings, optional

This specifies which warnings to configure as 'raise' instead of being shown once during the test execution. Valid strings are:

timer : bool or int, optional

Timing of individual tests with nose-timer (which needs to be installed). If True, time tests and report on all of them. If an integer (say N ), report timing results for N slowest tests.

Returns

result : object

Returns the result of running the tests as a nose.result.TextTestResult object.

Run tests for module using nose.

Examples

This example is valid syntax, but we were not able to check execution
>>> result = np.lib.test() #doctest: +SKIP
Running unit tests for numpy.lib
...
Ran 976 tests in 3.933s

OK

This example is valid syntax, but we were not able to check execution
>>> result.errors #doctest: +SKIP
[]
This example is valid syntax, but we were not able to check execution
>>> result.knownfail #doctest: +SKIP
[]
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.testing._private.nosetester.NoseTester.prepare_test_args numpy._pytesttester.PytestTester.__call__ numpy.testing._private.nosetester.NoseTester.test

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/testing/_private/nosetester.py#326
type: <class 'function'>
Commit: