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

Class 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)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
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)
repr(x)

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

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)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)