diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-29 16:17:08 +0100 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-29 16:17:08 +0100 |
| commit | 2b0f2747531f0eee45c86e5111b15598e0b2613a (patch) | |
| tree | 23f8b7c0ed65291d5458c11c6bdb1d8be5581d48 /tests | |
| parent | 93a4cf4c5dae923cd1f8f43e360e5705bb24d910 (diff) | |
| download | trollius-git-2b0f2747531f0eee45c86e5111b15598e0b2613a.tar.gz | |
Python issue #23243: test_sslproto: Close explicitly transports
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_sslproto.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/test_sslproto.py b/tests/test_sslproto.py index 148e30d..a72967e 100644 --- a/tests/test_sslproto.py +++ b/tests/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) |
