unittest :: runner :: TextTestResult :: Class TextTestResult
[hide private]
[frames] | no frames]

Class TextTestResult


A test result class that can print formatted text results to a stream.

Used by TextTestRunner.

Instance Methods [hide private]
 
__init__(self, stream, descriptions, verbosity)
x.__init__(...) initializes x; see help(type(x)) for signature
 
addError(self, test, err)
Called when an error has occurred.
 
addExpectedFailure(self, test, err)
Called when an expected failure/error occurred.
 
addFailure(self, test, err)
Called when an error has occurred.
 
addSkip(self, test, reason)
Called when a test is skipped.
 
addSuccess(self, test)
Called when a test has completed successfully
 
addUnexpectedSuccess(self, test)
Called when a test was expected to fail, but succeed.
 
getDescription(self, test)
 
printErrorList(self, flavour, errors)
 
printErrors(self)
Called by TestRunner after test run
 
startTest(self, test)
Called when the given test is about to be run

Inherited from result.TestResult: __repr__, startTestRun, stop, stopTest, stopTestRun, wasSuccessful

Inherited from result.TestResult (private): _count_relevant_tb_levels, _exc_info_to_string, _is_relevant_tb_level, _restoreStdout, _setupStdout

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

Class Variables [hide private]
  separator1 = '================================================...
  separator2 = '------------------------------------------------...

Inherited from result.TestResult (private): _moduleSetUpFailed, _previousTestClass, _testRunEntered

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, stream, descriptions, verbosity)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) 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().

Overrides: result.TestResult.addError
(inherited documentation)

addExpectedFailure(self, test, err)

 

Called when an expected failure/error occurred.

Overrides: result.TestResult.addExpectedFailure
(inherited documentation)

addFailure(self, test, err)

 

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

Overrides: result.TestResult.addFailure
(inherited documentation)

addSkip(self, test, reason)

 

Called when a test is skipped.

Overrides: result.TestResult.addSkip
(inherited documentation)

addSuccess(self, test)

 

Called when a test has completed successfully

Overrides: result.TestResult.addSuccess
(inherited documentation)

addUnexpectedSuccess(self, test)

 

Called when a test was expected to fail, but succeed.

Overrides: result.TestResult.addUnexpectedSuccess
(inherited documentation)

printErrors(self)

 

Called by TestRunner after test run

Overrides: result.TestResult.printErrors
(inherited documentation)

startTest(self, test)

 

Called when the given test is about to be run

Overrides: result.TestResult.startTest
(inherited documentation)

Class Variable Details [hide private]

separator1

Value:
'=====================================================================\
='

separator2

Value:
'---------------------------------------------------------------------\
-'