def test_set_verify_callback_exception(self):
    '\n        If the verify callback passed to `Context.set_verify` raises an\n        exception, verification fails and the exception is propagated to the\n        caller of `Connection.do_handshake`.\n        '
    serverContext = Context(TLSv1_2_METHOD)
    serverContext.use_privatekey(load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM))
    serverContext.use_certificate(load_certificate(FILETYPE_PEM, cleartextCertificatePEM))
    clientContext = Context(TLSv1_2_METHOD)

    def verify_callback(*args):
        raise Exception('silly verify failure')
    clientContext.set_verify(VERIFY_PEER, verify_callback)
    with pytest.raises(Exception) as exc:
        self._handshake_test(serverContext, clientContext)
    assert ('silly verify failure' == str(exc.value))
If the verify callback passed to `Context.set_verify` raises an
exception, verification fails and the exception is propagated to the
caller of `Connection.do_handshake`.
def test_set_verify_callback_exception(self):
    '\n        If the verify callback passed to `Context.set_verify` raises an\n        exception, verification fails and the exception is propagated to the\n        caller of `Connection.do_handshake`.\n        '
    serverContext = Context(TLSv1_2_METHOD)
    serverContext.use_privatekey(load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM))
    serverContext.use_certificate(load_certificate(FILETYPE_PEM, cleartextCertificatePEM))
    clientContext = Context(TLSv1_2_METHOD)

    def verify_callback(*args):
        raise Exception('silly verify failure')
    clientContext.set_verify(VERIFY_PEER, verify_callback)
    with pytest.raises(Exception) as exc:
        self._handshake_test(serverContext, clientContext)
    assert ('silly verify failure' == str(exc.value))