mvpa2.testing.toolsΒΆ
A Collection of tools found useful in unittests.
Primarily the ones from nose.tools
Functions
assert_almost_equal (actual, desired[, ...]) |
Raises an AssertionError if two items are not equal up to desired precision. | ||
assert_approx_equal (actual, desired[, ...]) |
Raises an AssertionError if two items are not equal up to significant digits. | ||
assert_array_almost_equal (x, y[, decimal, ...]) |
Raises an AssertionError if two objects are not equal up to desired precision. | ||
assert_array_equal (x, y[, err_msg, verbose]) |
Raises an AssertionError if two array_like objects are not equal. | ||
assert_array_lequal (x, y) |
|||
assert_array_less (x, y[, err_msg, verbose]) |
Raises an AssertionError if two array_like objects are not ordered by less than. | ||
assert_collections_equal (x, y[, ignore]) |
|||
assert_datasets_almost_equal (x, y[, ...]) |
|
||
assert_datasets_equal (x, y[, ignore_a, ...]) |
|
||
assert_dict_keys_equal (x, y) |
|||
assert_objectarray_equal (x, y[, xorig, ...]) |
Wrapper around assert_array_equal to compare object arrays | ||
assert_reprstr_equal (x, y) |
Whenever comparison fails otherwise, we might revert to compare those | ||
assert_string_equal (actual, desired) |
Test if two strings are equal. | ||
assert_warnings (\*args, \*\*kwds) |
|||
contextmanager (func) |
@contextmanager decorator. | ||
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 of the decorated function, including nose’s additional stuff (namely, setup and teardown). | ||
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. | ||
pathjoin (a, \*p) |
Join two or more pathname components, inserting ‘/’ as needed. | ||
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 | ||
skipif (skip_condition[, msg]) |
Make function raise SkipTest exception if a given condition is true. | ||
strip_strid (s) |
Strip off strids (#NUMBER) within a string | ||
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_tempfile (\*targs, \*\*tkwargs) |
Decorator function to provide a temporary file name and remove it at the end. |
Exceptions