mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
asyncio, Tulip issue 171: BaseEventLoop.close() now raises an exception if the
event loop is running. You must first stop the event loop and then wait until it stopped, before closing it.
This commit is contained in:
parent
62511fd6d6
commit
f328c7dc69
6 changed files with 18 additions and 3 deletions
|
@ -1365,6 +1365,15 @@ class EventLoopTestsMixin:
|
|||
with self.assertRaises(RuntimeError):
|
||||
loop.add_writer(w, callback)
|
||||
|
||||
def test_close_running_event_loop(self):
|
||||
@asyncio.coroutine
|
||||
def close_loop(loop):
|
||||
self.loop.close()
|
||||
|
||||
coro = close_loop(self.loop)
|
||||
with self.assertRaises(RuntimeError):
|
||||
self.loop.run_until_complete(coro)
|
||||
|
||||
|
||||
class SubprocessTestsMixin:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue