From 3c0eabfa3fe1fedb95fa35157f76c0a7edbb6d66 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 16 Jan 2015 17:45:51 +0100 Subject: Enhance BaseProactorEventLoop._loop_self_reading() * Handle correctly CancelledError: just exit * On error, log the exception and exit Don't try to close the event loop, it is probably running and so it cannot be closed. --- tests/test_proactor_events.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test_proactor_events.py b/tests/test_proactor_events.py index dee147e..33a8a67 100644 --- a/tests/test_proactor_events.py +++ b/tests/test_proactor_events.py @@ -523,9 +523,10 @@ class BaseProactorEventLoopTests(test_utils.TestCase): def test_loop_self_reading_exception(self): self.loop.close = mock.Mock() + self.loop.call_exception_handler = mock.Mock() self.proactor.recv.side_effect = OSError() - self.assertRaises(OSError, self.loop._loop_self_reading) - self.assertTrue(self.loop.close.called) + self.loop._loop_self_reading() + self.assertTrue(self.loop.call_exception_handler.called) def test_write_to_self(self): self.loop._write_to_self() -- cgit v1.2.1