TestResult that logs its event to a list.
Method __init__ Undocumented
Method startTest Undocumented
Method stop Undocumented
Method stopTest Undocumented
Method addFailure Called when an error has occurred. 'err' is a tuple of values as returned by sys.exc_info().
Method addError Called when an error has occurred. 'err' is a tuple of values as returned by sys.exc_info().
Method addSkip Called when a test has been skipped rather than running.
Method addSuccess Called when a test succeeded.
Method startTestRun Called before a test run starts.
Method stopTestRun Called after a test run completes
Method done Called when the test runner is done.
Method tags Add and remove tags from the test.
Method time Provide a timestamp to represent the current time.

Inherited from TestResult:

Instance Variable skip_reasons A dict of skip-reasons -> list of tests. See addSkip.
Method addExpectedFailure Called when a test has failed in an expected manner.
Method addUnexpectedSuccess Called when a test was expected to fail, but succeed.
Method wasSuccessful Has this result been successful so far?
Method current_tags The currently set tags.
Method _err_details_to_string Convert an error in exc_info form or a contents dict to a string.
Method _exc_info_to_unicode Undocumented
Method _now Return the current 'test time'.
def __init__(self, log):
def startTest(self, test):
def stop(self):
Undocumented
def stopTest(self, test):
def addFailure(self, test, error):
Called when an error has occurred. 'err' is a tuple of values as returned by sys.exc_info().
ParametersdetailsAlternative way to supply details about the outcome. see the class docstring for more information.
def addError(self, test, error):
Called when an error has occurred. 'err' is a tuple of values as returned by sys.exc_info().
ParametersdetailsAlternative way to supply details about the outcome. see the class docstring for more information.
def addSkip(self, test, reason):

Called when a test has been skipped rather than running.

Like with addSuccess and addError, testStopped should still be called.

This must be called by the TestCase. 'addError' and 'addFailure' will not call addSkip, since they have no assumptions about the kind of errors that a test can raise.

ParameterstestThe test that has been skipped.
reasonThe reason for the test being skipped. For instance, u"pyGL is not available".
detailsAlternative way to supply details about the outcome. see the class docstring for more information.
ReturnsNone
def addSuccess(self, test):
Called when a test succeeded.
def startTestRun(self):

Called before a test run starts.

New in Python 2.7. The testtools version resets the result to a pristine condition ready for use in another test run. Note that this is different from Python 2.7's startTestRun, which does nothing.

def stopTestRun(self):

Called after a test run completes

New in python 2.7

def done(self):

Called when the test runner is done.

deprecated in favour of stopTestRun.

def tags(self, new_tags, gone_tags):
Add and remove tags from the test.
Parametersnew_tagsA set of tags to be added to the stream.
gone_tagsA set of tags to be removed from the stream.
def time(self, a_datetime):

Provide a timestamp to represent the current time.

This is useful when test activity is time delayed, or happening concurrently and getting the system time between API calls will not accurately represent the duration of tests (or the whole run).

Calling time() sets the datetime used by the TestResult object. Time is permitted to go backwards when using this call.

Parametersa_datetimeA datetime.datetime object with TZ information or None to reset the TestResult to gathering time from the system.
API Documentation for testtools, generated by pydoctor at 2015-07-01 16:11:28.