fluidsim.util.testing

Utilities for the unittests (fluidsim.util.testing)

This module extends the functionalities provide by the unittest standard library. It enforces matplotlib to use its Agg backend, thereby smoothly executing plotting tests without window pop-ups. It is also useful to execute this module to run FluidSim unittests, without going into the source directory for eg. when it is installed through pip.

Functions

collect_tests(verbose, no_capture, *modules)

Creates a TestSuite from several modules.

deactivate_redirect_stdout(tests)

discover_tests([verbose, no_capture, …])

Discovers all tests under a module or directory.

import_test_module(module_name)

Smarter import handling common mistakes with warnings.

init_parser(parser)

Initialize argument parser for fluidsim-test.

run([args])

Run fluidsim-test command.

Classes

TestCase([methodName])

TestSimul([methodName])

TestSimulConserve([methodName])

A test case which makes it easy to test for energy and enstrophy conservation.

TestSimulConserveOutput([methodName])

A test case with methods to easily test for the output modules.

TimeLoggingTestResult(*args, **kwargs)

TimeLoggingTestRunner([slow_test_threshold])