Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`trial`.`reporter`.`TestResult``

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.TestCase`s.

Method | `__init__` | Undocumented
Method | `__repr__` | Undocumented
Method | `addError` | Report an error that occurred while running the given test.
Method | `addExpectedFailure` | Report that the given test failed, and was expected to do so.
Method | `addFailure` | Report a failed assertion for the given test.
Method | `addSkip` | Report that the given test was skipped.
Method | `addSuccess` | Report that the given test succeeded.
Method | `addUnexpectedSuccess` | Report that the given test succeeded against expectations.
Method | `done` | The test suite has finished running.
Method | `startTest` | This must be called before the given test is commenced.
Method | `stopTest` | This must be called after the given test is completed.
Method | `wasSuccessful` | Report whether or not this test suite was successful or not.
Instance Variable | `expectedFailures` | Undocumented
Instance Variable | `skips` | Undocumented
Instance Variable | `successes` | count the number of successes achieved by the test run.
Instance Variable | `unexpectedSuccesses` | Undocumented
Method | `_getFailure` | Convert a `sys.exc_info()`-style tuple to a `Failure`, if necessary.
Method | `_getTime` | Undocumented
Constant | `_DEFAULT_TODO` | Undocumented
Instance Variable | `_lastTime` | Undocumented
Instance Variable | `_testStarted` | Undocumented
Instance Variable | `_timings` | Undocumented

def __init__(self): (source)
overridden in `twisted.trial._dist.workerreporter.WorkerReporter`, `twisted.trial.reporter.Reporter`

Undocumented

def __repr__(self): (source)

Undocumented

Returns
`str` | Undocumented

def addError(self, test, error): (source)
from `twisted.trial.itrial.IReporter`
overridden in `twisted.trial._dist.workerreporter.WorkerReporter`, `twisted.trial.reporter.Reporter`

Report an error that occurred while running the given test.

Parameters
test:`pyunit.TestCase` | Undocumented
error:`Failure` or `tuple` | Undocumented

def addExpectedFailure(self, test, error, todo=None): (source)
from `twisted.trial.itrial.IReporter`
overridden in `twisted.trial._dist.workerreporter.WorkerReporter`, `twisted.trial.reporter.TextReporter`, `twisted.trial.reporter.TreeReporter`, `twisted.trial.reporter.VerboseTextReporter`

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.TestCase` | Undocumented
error:`Failure` | Undocumented
todo:`unittest.Todo`, or `None`, in which case a default todo message is provided. | Undocumented

def addFailure(self, test, fail): (source)
from `twisted.trial.itrial.IReporter`
overridden in `twisted.trial._dist.workerreporter.WorkerReporter`, `twisted.trial.reporter.Reporter`

Report a failed assertion for the given test.

Parameters
test:`pyunit.TestCase` | Undocumented
fail:`Failure` or `tuple` | Undocumented

def addSkip(self, test, reason): (source)
from `twisted.trial.itrial.IReporter`
overridden in `twisted.trial._dist.workerreporter.WorkerReporter`, `twisted.trial.reporter.TextReporter`, `twisted.trial.reporter.TreeReporter`, `twisted.trial.reporter.VerboseTextReporter`

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.TestCase` | Undocumented
reason:`str` | Undocumented

def addSuccess(self, test): (source)
from `twisted.trial.itrial.IReporter`
overridden in `twisted.trial._dist.workerreporter.WorkerReporter`, `twisted.trial.reporter.TextReporter`, `twisted.trial.reporter.TreeReporter`, `twisted.trial.reporter.VerboseTextReporter`

Report that the given test succeeded.

Parameters
test:`pyunit.TestCase` | Undocumented

def addUnexpectedSuccess(self, test, todo=None): (source)
from `twisted.trial.itrial.IReporter`
overridden in `twisted.trial._dist.workerreporter.WorkerReporter`, `twisted.trial.reporter.TextReporter`, `twisted.trial.reporter.TreeReporter`, `twisted.trial.reporter.VerboseTextReporter`

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.TestCase` | Undocumented
todo:`unittest.Todo`, or `None`, in which case a default todo message is provided. | Undocumented

def done(self): (source)
from `twisted.trial.itrial.IReporter`
overridden in `twisted.trial.reporter.Reporter`

The test suite has finished running.

def startTest(self, test): (source)
from `twisted.trial.itrial.IReporter`
overridden in `twisted.trial.reporter.Reporter`

This must be called before the given test is commenced.

Parameters
test:`pyunit.TestCase` | Undocumented

def stopTest(self, test): (source)
from `twisted.trial.itrial.IReporter`
overridden in `twisted.trial.reporter.VerboseTextReporter`

This must be called after the given test is completed.

Parameters
test:`pyunit.TestCase` | Undocumented

def wasSuccessful(self): (source)
from `twisted.trial.itrial.IReporter`

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
`bool` | Undocumented

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)
overridden in `twisted.trial._dist.workerreporter.WorkerReporter`

Convert a `sys.exc_info()`-style tuple to a `Failure`, if necessary.

def _getTime(self): (source)

Undocumented

_DEFAULT_TODO: `str` = (source)
overridden in `twisted.trial._dist.workerreporter.WorkerReporter`

Undocumented

Value

    'Test expected to fail'

_lastTime = (source)

Undocumented

_testStarted = (source)

Undocumented

_timings: `list` = (source)

Undocumented