esys.escriptcore.testing Package¶
A small set of functions to automate test discovery and running and also allow specific tests to be run without modifying the test scripts themselves.
When imported into a test file, any external script can import the test file module and run tests as they wish.
Both specific and general forms of the functions return the result state,
allowing access to list all skipped tests and other data kept by the
TestTextResults
returned.
Examples:
Running all test classes:
import your_test_module_or_file as tests
tests.run_tests("your_test_module_or_file")
Running specific test classes:
import your_test_module_or_file as tests
tests.run_tests("your_test_module_or_file", [tests.Test_classA, tests.Test_classB])
Running a specific test within a class:
import your_test_module_or_file as tests
tests.run_single_test(tests.Test_classname("test_functionname"))
Printing the list of skipped tests:
results = tests.run_tests("name")
for skipped_test in results.skipped:
print(skipped_test)
-
esys.escriptcore.testing.
run_single_test
(test, exit_on_failure=False)¶
-
esys.escriptcore.testing.
run_tests
(modulename, classes=[], exit_on_failure=False)¶
Classes¶
Functions¶
-
esys.escriptcore.testing.
MPIBarrierWorld
() → None :¶ Wait until all MPI processes have reached this point.
-
esys.escriptcore.testing.
__add_tests
(suite, modulename)¶
-
esys.escriptcore.testing.
getMPIRankWorld
() → int :¶ Return the rank of this process in the MPI World.
-
esys.escriptcore.testing.
run_single_test
(test, exit_on_failure=False)
-
esys.escriptcore.testing.
run_tests
(modulename, classes=[], exit_on_failure=False)
Others¶
- __builtins__
- __copyright__
- __doc__
- __file__
- __license__
- __name__
- __package__
- __url__
- division
- print_function