Module unittest :: Class TestResult
[hide private]
[frames] | no frames]

type TestResult

object --+
         |
        TestResult
Known Subclasses:

Holder for test result information.

Test results are automatically managed by the TestCase and TestSuite classes, and do not need to be explicitly manipulated by writers of tests.

Each instance holds the total number of tests run, and collections of failures and errors that occurred among those test runs. The collections contain tuples of (testcase, exceptioninfo), where exceptioninfo is the formatted traceback of the error that occurred.

Instance Methods [hide private]
 
__init__(self)
 
startTest(self, test)
Called when the given test is about to be run
 
stopTest(self, test)
Called when the given test has been run
 
addError(self, test, err)
Called when an error has occurred.
 
addFailure(self, test, err)
Called when an error has occurred.
 
addSuccess(self, test)
Called when a test has completed successfully
 
wasSuccessful(self)
Tells whether or not this result was a success
 
stop(self)
Indicates that the tests should be aborted
 
_exc_info_to_string(self, err, test)
Converts a sys.exc_info()-style tuple of values into a string.
 
_is_relevant_tb_level(self, tb)
 
_count_relevant_tb_levels(self, tb)
 
__repr__(self)
Method Details [hide private]

__init__(self)
(Constructor)

 
Overrides: object.__init__
(inherited documentation)

addError(self, test, err)

 

Called when an error has occurred. 'err' is a tuple of values as returned by sys.exc_info().

addFailure(self, test, err)

 

Called when an error has occurred. 'err' is a tuple of values as returned by sys.exc_info().

__repr__(self)
(Representation operator)

 
Overrides: object.__repr__
(inherited documentation)