From 190e78603a4ce58a2f248fdf8a3472fa1fc6c064 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 29 Jan 2015 17:32:39 +0100 Subject: Python issue #23243: On Python 3.4 and newer, emit a ResourceWarning when an event loop or a transport is not explicitly closed --- tests/test_proactor_events.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_proactor_events.py b/tests/test_proactor_events.py index 33a8a67..fcd9ab1 100644 --- a/tests/test_proactor_events.py +++ b/tests/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()) -- cgit v1.2.1