def test_failureResultOfWithWrongFailure(self):
        """
        L{SynchronousTestCase.failureResultOf} raises
        L{SynchronousTestCase.failureException} when called with a L{Deferred}
        with a failure type that was not expected.
        """
        self.assertRaises(
            self.failureException, self.failureResultOf, fail(self.failure),
            KeyError)

        L{SynchronousTestCase.failureResultOf} raises
        L{SynchronousTestCase.failureException} when called with a L{Deferred}
        with a failure type that was not expected.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_assertions.py