diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-29 17:50:58 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-29 17:50:58 +0100 |
commit | 978a9afc6af6c137065bdcf7ae4ef5450e5b2ec2 (patch) | |
tree | 54eb1a4cdf09be18b62c40e0e203a347c37c4cd6 /Lib/test/test_asyncio/test_proactor_events.py | |
parent | 3c0cf05901ea5cca0694734fd4a64b2bc267cb41 (diff) | |
download | cpython-978a9afc6af6c137065bdcf7ae4ef5450e5b2ec2.tar.gz cpython-978a9afc6af6c137065bdcf7ae4ef5450e5b2ec2.zip |
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_proactor_events.py')
-rw-r--r-- | Lib/test/test_asyncio/test_proactor_events.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py index 33a8a671ec1..fcd9ab1e18f 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()) |