testutils

Testing utilities.

Classes

ProgressBar([text])

A simple command-line progress bar.

ProgressRange(text, n)

Simple range sequence with progress bar output

Functions

all_almost_equal(iter1, iter2[, ndigits])

Return True if all elements in a and b are almost equal.

all_almost_equal_array(v1, v2, ndigits)

all_equal(iter1, iter2)

Return True if all elements in a and b are equal.

dtype_ndigits(dtype[, default])

Return the number of correct digits expected for a given dtype.

dtype_tol(dtype[, default])

Return a tolerance for a given dtype.

fail_counter(test_name[, err_msg, logger])

Used to count the number of failures of something.

is_subdict(subdict, dictionary)

Return True if all items of subdict are in dictionary.

noise_array(space)

Generate a white noise array that is compatible with space.

noise_element(space)

Create a white noise element in space.

noise_elements(space[, n])

Create a list of n noise arrays and elements in space.

run_doctests([skip_if])

Run all doctests in the current module.

simple_fixture(name, params[, fmt])

Helper to create a pytest fixture using only name and params.

test([arguments])

Run ODL tests given by arguments.

test_file(file[, args])

Run tests in file with proper default arguments.

timeit(arg)

A timer decorator.

timer([name])

A timer context manager.