unittest.TestResult.stop()

stop() This method can be called to signal that the set of tests being run should be aborted by setting the shouldStop attribute to True. TestRunner objects should respect this flag and return without running any additional tests. For example, this feature is used by the TextTestRunner class to stop the test framework when the user signals an interrupt from the keyboard. Interactive tools which provide TestRunner implementations can use this in a similar manner.

unittest.TestResult.startTestRun()

startTestRun() Called once before any tests are executed. New in version 3.1.

unittest.TestResult.startTest()

startTest(test) Called when the test case test is about to be run.

unittest.TestResult.skipped

skipped A list containing 2-tuples of TestCase instances and strings holding the reason for skipping the test. New in version 3.1.

unittest.TestResult.shouldStop

shouldStop Set to True when the execution of tests should stop by stop().

unittest.TestResult.failures

failures A list containing 2-tuples of TestCase instances and strings holding formatted tracebacks. Each tuple represents a test where a failure was explicitly signalled using the TestCase.assert*() methods.

unittest.TestResult.failfast

failfast If set to true stop() will be called on the first failure or error, halting the test run. New in version 3.2.

unittest.TestResult.expectedFailures

expectedFailures A list containing 2-tuples of TestCase instances and strings holding formatted tracebacks. Each tuple represents an expected failure of the test case.

unittest.TestResult.errors

errors A list containing 2-tuples of TestCase instances and strings holding formatted tracebacks. Each tuple represents a test which raised an unexpected exception.

unittest.TestResult.buffer

buffer If set to true, sys.stdout and sys.stderr will be buffered in between startTest() and stopTest() being called. Collected output will only be echoed onto the real sys.stdout and sys.stderr if the test fails or errors. Any output is also attached to the failure / error message. New in version 3.2.