You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During cleanup, should pytest-asyncio cancel outstanding tasks, shut down async generators, and shut down the thread pool, like asyncio.run() does? #222
Before calling loop.close(), asyncio.run() does this:
It attempts to cancel outstanding tasks with _cancel_all_tasks().
It calls loop.shutdown_asyncgens()
It calls loop.shutdown_default_executor().
(I think (2) and (3) correspond to what the documentation calls "finalizing asynchronous generators and closing the threadpool.")
I only have a tenuous grasp on these asyncio internals, but it seems like the event_loop fixture should do this, too? And so should any other place in pytest-asyncio where the event loop is shut down, if there are more.