diff options
-rw-r--r-- | Lib/test/test_ssl.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 2aa265a..f00478c 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -11,6 +11,7 @@ import pprint import urllib.parse, urllib.request import traceback import asyncore +import weakref from http.server import HTTPServer, SimpleHTTPRequestHandler @@ -138,6 +139,16 @@ class BasicTests(unittest.TestCase): with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be selected"): s.connect(remote) + @support.cpython_only + def test_refcycle(self): + # Issue #7943: an SSL object doesn't create reference cycles with + # itself. + s = socket.socket(socket.AF_INET) + ss = ssl.wrap_socket(s) + wr = weakref.ref(ss) + del ss + self.assertEqual(wr(), None) + class NetworkedTests(unittest.TestCase): |