def test_failureVerifyingKey(self):
        """
        If L{keys.Key.verify} raises an exception,
        L{checkers.SSHPublicKeyChecker.requestAvatarId} fails with
        L{UnauthorizedLogin}.
        """
        def fail(*args, **kwargs):
            raise _DummyException()

        self.patch(keys.Key, 'verify', fail)

        self.failureResultOf(self.checker.requestAvatarId(self.credentials),
                             UnauthorizedLogin)
        self.flushLoggedErrors(_DummyException)

        If L{keys.Key.verify} raises an exception,
        L{checkers.SSHPublicKeyChecker.requestAvatarId} fails with
        L{UnauthorizedLogin}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_checkers.py