MCPcopy Index your code
hub / github.com/python/cpython / test_sni_callback_refcycle

Method test_sni_callback_refcycle

Lib/test/test_ssl.py:1597–1607  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1595 self.assertEqual(cm.exception.errno, ssl.SSL_ERROR_SSL)
1596
1597 def test_sni_callback_refcycle(self):
1598 # Reference cycles through the servername callback are detected
1599 # and cleared.
1600 ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
1601 def dummycallback(sock, servername, ctx, cycle=ctx):
1602 pass
1603 ctx.set_servername_callback(dummycallback)
1604 wr = weakref.ref(ctx)
1605 del ctx, dummycallback
1606 gc.collect()
1607 self.assertIs(wr(), None)
1608
1609 def test_cert_store_stats(self):
1610 ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)

Callers

nothing calls this directly

Calls 3

collectMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected