mpi_array.unittest.main¶
-
mpi_array.unittest.
main
(module_name, log_level=10, init_logger_names=None, verbosity=None, failfast=None)[source]¶ Like
unittest.main()
, initialiseslogging.Logger
objects and instantiates aTestProgram
to discover and runTestCase
objects. Loads a set of tests from module and runs them; this is primarily for making test modules conveniently executable. The simplest use for this function is to include the following line at the end of a test module:mpi_array.unittest.main(__name__)
If
__name__ == "__main__"
, then discoverableunittest.TestCase
test cases are executed. Logging level can be explicitly set for a group of modules using:import logging mpi_array.unittest.main( __name__, logging.DEBUG, [__name__, "module_name_0", "module_name_1", "package.module_name_2"] )
Parameters: - module_name (
str
) – Ifmodule_name == "__main__"
then unit-tests are discovered and run. - log_level (
int
) – The default logging level for allmpi_array.logging.Logger
objects. - init_logger_names (sequence of
str
) – List of logger names to initialise (usingmpi_array.logging.initialise_loggers()
). IfNone
, then the list defaults to[module_name, "mpi_array"]
. If list is empty no loggers are initialised.
- module_name (