[Python-checkins] bpo-37322: Fix test_ssl.test_pha_required_nocert() ResourceWarning (GH-14662)

Victor Stinner webhook-mailer at python.org
Tue Jul 9 06:37:00 EDT 2019


https://github.com/python/cpython/commit/cf9c41c422de3774862db964fe3153086bad3f61
commit: cf9c41c422de3774862db964fe3153086bad3f61
branch: master
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2019-07-09T12:36:55+02:00
summary:

bpo-37322: Fix test_ssl.test_pha_required_nocert() ResourceWarning (GH-14662)

Close the TLS connection in test_pha_required_nocert() of test_ssl to
fix a ResourceWarning.

files:
M Lib/test/test_ssl.py

diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index d2b9e2046d0e..166e28683e26 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -2382,6 +2382,7 @@ def run(self):
                         if self.server.chatty and support.verbose:
                             sys.stdout.write(err.args[1])
                         # test_pha_required_nocert is expecting this exception
+                        self.close()
                         raise ssl.SSLError('tlsv13 alert certificate required')
                 except OSError:
                     if self.server.chatty:



More information about the Python-checkins mailing list