fail_counter

odl.util.testutils.fail_counter(test_name, err_msg=None, logger=<built-in function print>)[source]

Used to count the number of failures of something.

Usage:

with fail_counter("my_test") as counter:
    # Do stuff

    counter.fail()

When done, it prints

my_test
*** FAILED 1 TEST CASE(S) ***