testtools.deferredruntest
module documentationtesttools
Individual test case execution for tests that return Deferreds.
This module is highly experimental and is liable to change in ways that cause subtle failures in tests. Use at your own peril.
Class | SynchronousDeferredRunTest | Runner for tests that return synchronous Deferreds. |
Function | run_with_log_observers | Run 'function' with the given Twisted log observers. |
Class | AsynchronousDeferredRunTest | Runner for tests that return Deferreds that fire asynchronously. |
Class | AsynchronousDeferredRunTestForBrokenTwisted | Test runner that works around Twisted brokenness re reactor junk. |
Function | assert_fails_with | Assert that 'd' will fail with one of 'exc_types'. |
Function | flush_logged_errors | Undocumented |
Class | UncleanReactorError | Raised when the reactor has junk in it. |
Class | _DeferredRunTest | Base for tests that return Deferreds. |
Assert that 'd' will fail with one of 'exc_types'.
The normal way to use this is to return the result of 'assert_fails_with' from your unit test.
Note that this function is experimental and unstable. Use at your own peril; expect the API to change.
Parameters | d | A Deferred that is expected to fail. |
exc_types | The exception types that the Deferred is expected to fail with. | |
failureException | An optional keyword argument. If provided, will raise that exception instead of testtools.TestCase.failureException. | |
Returns | A Deferred that will fail with an AssertionError if 'd' does not fail with one of the exception types. |