A helper for implementing assertRaises. This is a context manager and a helper method to support the non-context manager version of assertRaises.

Instance Variable exception The exception which was raised by the function being tested (if it raised one).
Method __init__
Method __enter__ Undocumented
Method __exit__ Check exit exception against expected exception.
Instance Variable _testCase See testCase parameter of __init__
Instance Variable _expected See expected parameter of __init__
Instance Variable _returnValue The value returned by the callable being tested (only when not being used as a context manager).
Instance Variable _expectedName A short string describing the expected exception (usually the name of the exception class).
Method _handle Call the given object using this object as a context manager.
_testCase =
See testCase parameter of __init__
_expected =
See expected parameter of __init__
_returnValue =
The value returned by the callable being tested (only when not being used as a context manager).
_expectedName =
A short string describing the expected exception (usually the name of the exception class).
exception =
The exception which was raised by the function being tested (if it raised one).
def __init__(self, testCase, expected): (source)
ParameterstestCaseThe TestCase instance which is used to raise a test-failing exception when that is necessary.
expectedThe exception type expected to be raised.
def _handle(self, obj): (source)

Call the given object using this object as a context manager.

ParametersobjThe object to call and which is expected to raise some exception. (type: object)
ReturnsWhatever exception is raised by obj(). (type: BaseException)
def __enter__(self): (source)
Undocumented
def __exit__(self, exceptionType, exceptionValue, traceback): (source)

Check exit exception against expected exception.

API Documentation for Twisted, generated by pydoctor at 2018-07-14 04:53:34.