8000 Python issue #23243: test_sslproto: Close explicitly transports · python/asyncio@2b0f274 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

Commit 2b0f274

Browse files
committed
Python issue #23243: test_sslproto: Close explicitly transports
1 parent 93a4cf4 commit 2b0f274

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/test_sslproto.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ def setUp(self):
2222
def ssl_protocol(self, waiter=None):
2323
sslcontext = test_utils.dummy_ssl_context()
2424
app_proto = asyncio.Protocol()
25-
return sslproto.SSLProtocol(self.loop, app_proto, sslcontext, waiter)
25+
proto = sslproto.SSLProtocol(self.loop, app_proto, sslcontext, waiter)
26+
self.addCleanup(proto._app_transport.close)
27+
return proto
2628

2729
def connection_made(self, ssl_proto, do_handshake=None):
2830
transport = mock.Mock()
@@ -56,9 +58,6 @@ def do_handshake(callback):
5658
with test_utils.disable_logger():
5759
self.loop.run_until_complete(handshake_fut)
5860

59-
# Close the transport
60-
ssl_proto._app_transport.close()
61-
6261
def test_eof_received_waiter(self):
6362
waiter = asyncio.Future(loop=self.loop)
6463
ssl_proto = self.ssl_protocol(waiter)

0 commit comments

Comments
 (0)
0