def assertRequestRaisedRuntimeError(self):
        """
        Assert that the request we just made raised a RuntimeError (and only a
        RuntimeError).
        """
        errors = self.flushLoggedErrors(RuntimeError)
        self.assertEqual(len(errors), 1, "Multiple RuntimeErrors raised: %s" %
                          '\n'.join([repr(error) for error in errors]))
        errors[0].trap(RuntimeError)

        Assert that the request we just made raised a RuntimeError (and only a
        RuntimeError).
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_session.py