Part of bzrlib.tests View In Hierarchy
Known subclasses: bzrlib.tests.test_selftest.TestPostMortemDebugging.TracebackRecordingResult, bzrlib.tests.test_selftest.TestThreadLeakDetection.LeakRecordingResult, bzrlib.tests.TextTestResult, bzrlib.tests.VerboseTestResult
Compared to the unittest version this class adds support for profiling, benchmarking, stopping as soon as a test fails, and skipping tests. There are further-specialized subclasses for different types of display.
When a test finishes, in whatever way, it calls one of the addSuccess, addFailure or addError classes. These in turn may redirect to a more specific case for the special test results supported by our extended tests.
Note that just one of these objects is fed the results from many tests.
Method | __init__ | Construct new TestResult. |
Method | stopTestRun | Undocumented |
Method | getDescription | Undocumented |
Method | startTest | Undocumented |
Method | stopTest | Undocumented |
Method | startTests | Undocumented |
Method | addError | Tell result that test finished with an error. |
Method | addFailure | Tell result that test failed. |
Method | addSuccess | Tell result that test completed successfully. |
Method | addExpectedFailure | Undocumented |
Method | addUnexpectedSuccess | Tell result the test unexpectedly passed, counting as a failure |
Method | addNotSupported | The test will not be run because of a missing feature. |
Method | addSkip | A test has not run for 'reason'. |
Method | addNotApplicable | Undocumented |
Method | progress | The test is adjusting the count of tests to run. |
Method | report_tests_starting | Display information before the test run begins |
Method | report_test_start | Display information on the test just about to be run |
Method | startTestRun | Undocumented |
Method | report_success | Undocumented |
Method | wasStrictlySuccessful | Undocumented |
Method | _extractBenchmarkTime | Add a benchmark time for the current test case. |
Method | _elapsedTestTimeString | Return a time string for the overall time the current test has taken. |
Method | _testTimeString | Undocumented |
Method | _formatTime | Format seconds as milliseconds with leading spaces. |
Method | _shortened_test_description | Undocumented |
Method | _record_traceback_from_test | Store the traceback from passed exc_info tuple till |
Method | _check_leaked_threads | See if any threads have leaked since last call |
Method | _recordTestStartTime | Record that a test has started. |
Method | _count_stored_tests | Count of tests instances kept alive due to not succeeding |
Method | _post_mortem | Start a PDB post mortem session. |
Method | _report_thread_leak | Display information on a test that leaked one or more threads |
Parameters | bench_history | Optionally, a writable file object to accumulate benchmark results. |
A sample of live threads is stored in the _active_threads attribute, when this method runs it compares the current live threads and any not in the previous sample are treated as having leaked.
Called from the TestCase run() method when the test fails with an unexpected error.
Called from the TestCase run() method when the test fails because e.g. an assert() method failed.
Called from the TestCase run()
When the minimum version of testtools required becomes 0.9.8 this can be updated to use the new handling there.