class documentation

class TestResult(pyunit.TestResult): (source)

Known subclasses: twisted.trial._dist.workerreporter.WorkerReporter, twisted.trial.reporter.Reporter

Implements interfaces: twisted.trial.itrial.IReporter

View In Hierarchy

Accumulates the results of several twisted.trial.unittest.TestCases.
Method __init__ Undocumented
Method __repr__ Undocumented
Method add​Error Report an error that occurred while running the given test.
Method add​Expected​Failure Report that the given test failed, and was expected to do so.
Method add​Failure Report a failed assertion for the given test.
Method add​Skip Report that the given test was skipped.
Method add​Success Report that the given test succeeded.
Method add​Unexpected​Success Report that the given test succeeded against expectations.
Method done The test suite has finished running.
Method start​Test This must be called before the given test is commenced.
Method stop​Test This must be called after the given test is completed.
Method was​Successful Report whether or not this test suite was successful or not.
Instance Variable expected​Failures Undocumented
Instance Variable skips Undocumented
Instance Variable successes count the number of successes achieved by the test run.
Instance Variable unexpected​Successes Undocumented
Method _get​Failure Convert a sys.exc_info()-style tuple to a Failure, if necessary.
Method _get​Time Undocumented
Constant _DEFAULT​_TODO Undocumented
Instance Variable _last​Time Undocumented
Instance Variable _test​Started Undocumented
Instance Variable _timings Undocumented
def __repr__(self): (source)

Undocumented

Returns
strUndocumented
def addError(self, test, error): (source)
Report an error that occurred while running the given test.
Parameters
test:pyunit.TestCaseUndocumented
error:Failure or tupleUndocumented
def addExpectedFailure(self, test, error, todo=None): (source)

Report that the given test failed, and was expected to do so.

In Trial, tests can be marked 'todo'. That is, they are expected to fail.

Parameters
test:pyunit.TestCaseUndocumented
error:FailureUndocumented
todo:unittest.Todo, or None, in which case a default todo message is provided.Undocumented
def addFailure(self, test, fail): (source)
Report a failed assertion for the given test.
Parameters
test:pyunit.TestCaseUndocumented
fail:Failure or tupleUndocumented
def addSkip(self, test, reason): (source)

Report that the given test was skipped.

In Trial, tests can be 'skipped'. Tests are skipped mostly because there is some platform or configuration issue that prevents them from being run correctly.

Parameters
test:pyunit.TestCaseUndocumented
reason:strUndocumented
def addUnexpectedSuccess(self, test, todo=None): (source)

Report that the given test succeeded against expectations.

In Trial, tests can be marked 'todo'. That is, they are expected to fail. When a test that is expected to fail instead succeeds, it should call this method to report the unexpected success.

Parameters
test:pyunit.TestCaseUndocumented
todo:unittest.Todo, or None, in which case a default todo message is provided.Undocumented
def done(self): (source)
The test suite has finished running.
def startTest(self, test): (source)
This must be called before the given test is commenced.
Parameters
test:pyunit.TestCaseUndocumented
def stopTest(self, test): (source)
This must be called after the given test is completed.
Parameters
test:pyunit.TestCaseUndocumented
def wasSuccessful(self): (source)

Report whether or not this test suite was successful or not.

The behaviour of this method changed in pyunit in Python 3.4 to fail if there are any errors, failures, or unexpected successes. Previous to 3.4, it was only if there were errors or failures. This method implements the old behaviour for backwards compatibility reasons, checking just for errors and failures.

Returns
boolUndocumented
expectedFailures: list = (source)

Undocumented

skips: list = (source)

Undocumented

successes: int = (source)
count the number of successes achieved by the test run.
unexpectedSuccesses: list = (source)

Undocumented

def _getFailure(self, error): (source)
Convert a sys.exc_info()-style tuple to a Failure, if necessary.
def _getTime(self): (source)

Undocumented

_DEFAULT_TODO: str = (source)

Undocumented

Value
'Test expected to fail'
_lastTime = (source)

Undocumented

_testStarted = (source)

Undocumented

_timings: list = (source)

Undocumented