summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ssl.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2013-01-10 20:16:20 (GMT)
committerBenjamin Peterson <benjamin@python.org>2013-01-10 20:16:20 (GMT)
commit36f7b97787f3428037ffa007bf93dadb738eef03 (patch)
tree784e50cbf1821bf57970fa6b9b1e0bb28f70c278 /Lib/test/test_ssl.py
parent7bd04867e53d78ddb0f5e8f78b9256298d41fadd (diff)
downloadcpython-36f7b97787f3428037ffa007bf93dadb738eef03.zip
cpython-36f7b97787f3428037ffa007bf93dadb738eef03.tar.gz
cpython-36f7b97787f3428037ffa007bf93dadb738eef03.tar.bz2
remove __del__ because it's evil and also prevents the ResourceWarning on the socket from happening (closes #16900)
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r--Lib/test/test_ssl.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 0a6af5e..2f63eaa 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -374,6 +374,14 @@ class BasicSocketTests(unittest.TestCase):
ss = ssl.wrap_socket(s, server_side=True, certfile=CERTFILE)
self.assertIsNone(ss.get_channel_binding("tls-unique"))
+ def test_dealloc_warn(self):
+ ss = ssl.wrap_socket(socket.socket(socket.AF_INET))
+ r = repr(ss)
+ with self.assertWarns(ResourceWarning) as cm:
+ ss = None
+ support.gc_collect()
+ self.assertIn(r, str(cm.warning.args[0]))
+
class ContextTests(unittest.TestCase):
@skip_if_broken_ubuntu_ssl