class NoseTester:
Nose test runner.
This class is made available as numpy.testing.Tester, and a test function is typically added to a package's __init__.py like so:
from numpy.testing import Tester test = Tester().test
Calling this test function finds and runs all tests associated with the package and all its sub-packages.
package
is set to the module from
which NoseTester
is initialized.This specifies which warnings to configure as 'raise' instead of being shown once during the test execution. Valid strings are:
- "develop" : equals (Warning,)
- "release" : equals (), don't raise on any warnings.
Default is "release".
package
is None, then this can be used to initialize from the
module of the caller of (the caller of (...)) the code that
initializes NoseTester
. Default of 0 means the module of the
immediate caller; higher values are useful for utility routines that
want to initialize NoseTester
objects on behalf of other code.Method | __init__ |
Undocumented |
Method | _get_custom_doctester |
Return instantiated plugin for doctests |
Method | _show_system_info |
Undocumented |
Method | _test_argv |
Generate argv for nosetest command |
Method | bench |
Run benchmarks for module using nose. |
Method | prepare_test_args |
Run tests for module using nose. |
Method | test |
Run tests for module using nose. |
Instance Variable | check_fpu_mode |
Undocumented |
Instance Variable | package_name |
Undocumented |
Instance Variable | package_path |
Undocumented |
Instance Variable | raise_warnings |
Undocumented |
Undocumented
Return instantiated plugin for doctests
Allows subclassing of this class to override doctester
A return value of None means use the nose builtin doctest plugin
Generate argv for nosetest command
Run benchmarks for module using nose.
Identifies the benchmarks 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:
Benchmarks are like tests, but have names starting with "bench" instead of "test", and can be found under the "benchmarks" sub-directory of the module.
Each NumPy module exposes bench
in its namespace to run all benchmarks
for it.
>>> success = np.lib.bench() #doctest: +SKIP Running benchmarks for numpy.lib ... using 562341 items: unique: 0.11 unique1d: 0.11 ratio: 1.0 nUnique: 56230 == 56230 ... OK
>>> success #doctest: +SKIP True
Run tests for module using nose.
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:
This specifies which warnings to configure as 'raise' instead of being shown once during the test execution. Valid strings are:
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
>>> result = np.lib.test() #doctest: +SKIP Running unit tests for numpy.lib ... Ran 976 tests in 3.933s
OK
>>> result.errors #doctest: +SKIP [] >>> result.knownfail #doctest: +SKIP []