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.
This commit is contained in:
Victor Stinner 2019-07-09 12:36:55 +02:00 committed by GitHub
parent 110a47c4f4
commit cf9c41c422
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -2382,6 +2382,7 @@ class ThreadedEchoServer(threading.Thread):
if self.server.chatty and support.verbose: if self.server.chatty and support.verbose:
sys.stdout.write(err.args[1]) sys.stdout.write(err.args[1])
# test_pha_required_nocert is expecting this exception # test_pha_required_nocert is expecting this exception
self.close()
raise ssl.SSLError('tlsv13 alert certificate required') raise ssl.SSLError('tlsv13 alert certificate required')
except OSError: except OSError:
if self.server.chatty: if self.server.chatty: