':py:obj:`Context.set_info_callback` accepts a callable which will be invoked
when certain information about an SSL connection is available.'

def test_set_info_callback(self):

    (server, client) = socket_pair()
    clientSSL = Connection(Context(TLSv1_METHOD), client)
    clientSSL.set_connect_state()
    called = []
    def info(conn, where, ret):
        called.append((conn, where, ret))
    context = Context(TLSv1_METHOD)
    context.set_info_callback(info)
    context.use_certificate(load_certificate(FILETYPE_PEM, cleartextCertificatePEM))
    context.use_privatekey(load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM))
    serverSSL = Connection(context, server)
    serverSSL.set_accept_state()
    handshake(clientSSL, serverSSL)
    notConnections = [conn for (conn, where, ret) in called if (not isinstance(conn, Connection))]
    self.assertEqual([], notConnections, 'Some    info    callback    arguments    were    not    Connection    instaces.')
