diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-29 16:50:58 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-29 16:50:58 (GMT) |
commit | 978a9afc6af6c137065bdcf7ae4ef5450e5b2ec2 (patch) | |
tree | 54eb1a4cdf09be18b62c40e0e203a347c37c4cd6 /Lib/test/test_asyncio/test_sslproto.py | |
parent | 3c0cf05901ea5cca0694734fd4a64b2bc267cb41 (diff) | |
download | cpython-978a9afc6af6c137065bdcf7ae4ef5450e5b2ec2.zip cpython-978a9afc6af6c137065bdcf7ae4ef5450e5b2ec2.tar.gz cpython-978a9afc6af6c137065bdcf7ae4ef5450e5b2ec2.tar.bz2 |
Issue #23243, asyncio: Emit a ResourceWarning when an event loop or a transport
is not explicitly closed. Close also explicitly transports in test_sslproto.
Diffstat (limited to 'Lib/test/test_asyncio/test_sslproto.py')
-rw-r--r-- | Lib/test/test_asyncio/test_sslproto.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py index 148e30d..a72967e 100644 --- a/Lib/test/test_asyncio/test_sslproto.py +++ b/Lib/test/test_asyncio/test_sslproto.py @@ -22,7 +22,9 @@ class SslProtoHandshakeTests(test_utils.TestCase): def ssl_protocol(self, waiter=None): sslcontext = test_utils.dummy_ssl_context() app_proto = asyncio.Protocol() - return sslproto.SSLProtocol(self.loop, app_proto, sslcontext, waiter) + proto = sslproto.SSLProtocol(self.loop, app_proto, sslcontext, waiter) + self.addCleanup(proto._app_transport.close) + return proto def connection_made(self, ssl_proto, do_handshake=None): transport = mock.Mock() @@ -56,9 +58,6 @@ class SslProtoHandshakeTests(test_utils.TestCase): with test_utils.disable_logger(): self.loop.run_until_complete(handshake_fut) - # Close the transport - ssl_proto._app_transport.close() - def test_eof_received_waiter(self): waiter = asyncio.Future(loop=self.loop) ssl_proto = self.ssl_protocol(waiter) |