diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-30 00:04:27 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-30 00:04:27 +0100 |
commit | 2647375cc98ac47dffdf495fc4b0fe5973b0375d (patch) | |
tree | df9bf8676f542e148b28c8950a3ee2cab0f1cc0b /Lib/test | |
parent | 29b40c1569e96182ba677f7d31bce45695913105 (diff) | |
parent | 978a9afc6af6c137065bdcf7ae4ef5450e5b2ec2 (diff) | |
download | cpython-git-2647375cc98ac47dffdf495fc4b0fe5973b0375d.tar.gz |
Merge 3.4 (asyncio)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_asyncio/test_proactor_events.py | 6 | ||||
-rw-r--r-- | Lib/test/test_asyncio/test_sslproto.py | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py index 33a8a671ec..fcd9ab1e18 100644 --- a/Lib/test/test_asyncio/test_proactor_events.py +++ b/Lib/test/test_asyncio/test_proactor_events.py @@ -499,8 +499,12 @@ class BaseProactorEventLoopTests(test_utils.TestCase): self.proactor.accept.assert_called_with(self.sock) def test_socketpair(self): + class EventLoop(BaseProactorEventLoop): + # override the destructor to not log a ResourceWarning + def __del__(self): + pass self.assertRaises( - NotImplementedError, BaseProactorEventLoop, self.proactor) + NotImplementedError, EventLoop, self.proactor) def test_make_socket_transport(self): tr = self.loop._make_socket_transport(self.sock, asyncio.Protocol()) diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py index 148e30dffe..a72967ea07 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) |