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

Class TestResult

source code

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
source code
 
startTest(self, test)
Called when the given test is about to be run
source code
 
stopTest(self, test)
Called when the given test has been run
source code
 
addError(self, test, err)
Called when an error has occurred.
source code
 
addFailure(self, test, err)
Called when an error has occurred.
source code
 
addSuccess(self, test)
Called when a test has completed successfully
source code
 
wasSuccessful(self)
Tells whether or not this result was a success
source code
 
stop(self)
Indicates that the tests should be aborted
source code
 
_exc_info_to_string(self, err, test)
Converts a sys.exc_info()-style tuple of values into a string.
source code
 
_is_relevant_tb_level(self, tb) source code
 
_count_relevant_tb_levels(self, tb) source code
 
__repr__(self)
repr(x)
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

addError(self, test, err)

source code 

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

addFailure(self, test, err)

source code 

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

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)