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`.`unittest``

module documentation
(source)

Things likely to be used by writers of unit tests.

Class | `PyUnitResultAdapter` | Wrap a `TestResult` from the standard library's `unittest` so that it supports the extended result types from Trial, and also supports `twisted.python.failure.Failure`s being passed to `addError` and `addFailure`...
Class | `SynchronousTestCase` | A unit test. The atom of the unit testing universe.
Class | `TestCase` | A unit test. The atom of the unit testing universe.
Class | `TestDecorator` | Decorator for test cases.
Class | `TestSuite` | Extend the standard library's `TestSuite` with a consistently overrideable `run` method.
Class | `Todo` | Internal object used to mark a `TestCase` as 'todo'. Tests marked 'todo' are reported differently in Trial `TestResult`s. If todo'd tests fail, they do not fail the suite and the errors are reported in a separate category...
Exception | `FailTest` | Raised to indicate the current test has failed to pass.
Function | `decorate` | Decorate all test cases in `test` with `decorator`.
Function | `makeTodo` | Return a `Todo` object built from `value`.

def decorate(test, decorator): (source)

Decorate all test cases in `test` with `decorator`.

`test` can be a test case or a test suite. If it is a test suite, then the structure of the suite is preserved.

`decorate` tries to preserve the class of the test suites it finds, but assumes the presence of the `_tests` attribute on the suite.

Parameters
test | The `TestCase` or `TestSuite` to decorate.
decorator | A unary callable used to decorate `TestCase`s.
Returns
A decorated `TestCase` or a `TestSuite` containing decorated `TestCase`s.

def makeTodo(value): (source)

Return a `Todo` object built from `value`.

If `value` is a string, return a Todo that expects any exception with `value` as a reason. If `value` is a tuple, the second element is used as the reason and the first element as the excepted error(s).

Parameters
value | A string or a tuple of `(errors, reason)`, where `errors` is either a single exception class or an iterable of exception classes.
Returns
A `Todo` object.