summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-21 22:38:37 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-01-21 22:38:37 (GMT)
commitcd0f7f9832e6aa8363f85152810738111b9a181d (patch)
treefb93436a2bd38cd77a2f4d22ab243449e207325b /Lib/test
parentb5684c48e1e37ff8fb1cf6cc42cae31bd2da37d8 (diff)
downloadcpython-cd0f7f9832e6aa8363f85152810738111b9a181d.zip
cpython-cd0f7f9832e6aa8363f85152810738111b9a181d.tar.gz
cpython-cd0f7f9832e6aa8363f85152810738111b9a181d.tar.bz2
asyncio: 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.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_asyncio/test_proactor_events.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py
index dee147e..33a8a67 100644
--- a/Lib/test/test_asyncio/test_proactor_events.py
+++ b/Lib/test/test_asyncio/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()