def test_old_callback_forgotten(self):
    '\n        If `Context.set_tlsext_servername_callback` is used to specify\n        a new callback, the one it replaces is dereferenced.\n        '

    def callback(connection):
        pass

    def replacement(connection):
        pass
    context = Context(TLSv1_METHOD)
    context.set_tlsext_servername_callback(callback)
    tracker = ref(callback)
    del callback
    context.set_tlsext_servername_callback(replacement)
    collect()
    collect()
    callback = tracker()
    if (callback is not None):
        referrers = get_referrers(callback)
        if (len(referrers) > 1):
            pytest.fail(('Some references remain: %r' % (referrers,)))
If `Context.set_tlsext_servername_callback` is used to specify
a new callback, the one it replaces is dereferenced.
def test_old_callback_forgotten(self):
    '\n        If `Context.set_tlsext_servername_callback` is used to specify\n        a new callback, the one it replaces is dereferenced.\n        '

    def callback(connection):
        pass

    def replacement(connection):
        pass
    context = Context(TLSv1_METHOD)
    context.set_tlsext_servername_callback(callback)
    tracker = ref(callback)
    del callback
    context.set_tlsext_servername_callback(replacement)
    collect()
    collect()
    callback = tracker()
    if (callback is not None):
        referrers = get_referrers(callback)
        if (len(referrers) > 1):
            pytest.fail(('Some references remain: %r' % (referrers,)))