summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_ssl.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index fb9c9a2..eab15ab 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -14,6 +14,7 @@ import urllib.parse, urllib.request
import shutil
import traceback
import asyncore
+import weakref
from http.server import HTTPServer, SimpleHTTPRequestHandler
@@ -97,6 +98,16 @@ class BasicTests(unittest.TestCase):
if (d1 != d2):
raise support.TestFailed("PEM-to-DER or DER-to-PEM translation failed")
+ @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):
def testConnect(self):