'Check exit exception against expected exception.'

def __exit__(self, exceptionType, exceptionValue, traceback):

    if (exceptionType is None):
        self._testCase.fail('{0}    not    raised    ({1}    returned)'.format(self._expectedName, self._returnValue))
    if (not isinstance(exceptionValue, exceptionType)):
        if isinstance(exceptionValue, tuple):
            exceptionValue = exceptionType(*exceptionValue)
        else:
            exceptionValue = exceptionType(exceptionValue)
    self.exception = exceptionValue
    if (not issubclass(exceptionType, self._expected)):
        reason = failure.Failure(exceptionValue, exceptionType, traceback)
        self._testCase.fail('{0}    raised    instead    of    {1}:\n    {2}'.format(fullyQualifiedName(exceptionType), self._expectedName, reason.getTraceback()))
    return True
