mvpa2.testingΒΆ

Helpers to unify/facilitate unittesting within PyMVPA

Functions

assert_almost_equal(actual, desired[, ...]) Raise an assertion if two items are not equal up to desired precision.
assert_approx_equal(actual, desired[, ...]) Raise an assertion if two items are not equal up to significant digits.
assert_array_almost_equal(x, y[, decimal, ...]) Raise an assertion if two objects are not equal up to desired precision.
assert_array_equal(x, y[, err_msg, verbose]) Raise an assertion if two array_like objects are not equal.
assert_array_lequal(x, y)
assert_array_less(x, y[, err_msg, verbose]) Raise an assertion if two array_like objects are not ordered by less than.
assert_objectarray_equal(x, y[, xorig, ...]) Wrapper around assert_array_equal to compare object arrays
assert_string_equal(actual, desired) Test if two strings are equal.
eq_(a, b[, msg]) Shorthand for ‘assert a == b, “%r != %r” % (a, b)
istest(func) Decorator to mark a function or method as a test
labile([niter, nfailures]) Decorator for labile tests – runs multiple times
make_decorator(func) Wraps a test decorator so as to properly replicate metadata
nodebug([entries]) Decorator to temporarily turn off some debug targets
nottest(func) Decorator to mark a function or method as not a test
ok_(expr[, msg]) Shorthand for assert.
raises(*exceptions) Test must raise one of expected exceptions to pass.
reseed_rng() Decorator to assure the use of MVPA_SEED while running the test
skip_if_no_external(dep[, ver_dep, ...]) Raise SkipTest if external is missing
sweepargs(**kwargs) Decorator function to sweep over a given set of classifiers
timed(limit) Test must finish within specified time limit to pass.
with_setup([setup, teardown]) Decorator to add setup and/or teardown methods to a test function:: @with_setup(setup, teardown) def test_something(): ” ...
with_tempfile(*targs, **tkwargs) Decorator function to provide a temporary file name and remove it at the end.

Exceptions

NeuroDebian

NITRC-listed