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
{{ message }}
This repository was archived by the owner on Nov 23, 2017. It is now read-only.
I'm the maintainer of pytest-asyncio. Pytest-asyncio allows users to block access to the global event loop, and pass the event loop explicitly; this is considered by some in the community as a best-practices approach.
However I've just received a bug report this approach doesn't work with subprocess (on Unix at least). Consider this test:
can't the event_loop instance passed in be used for this functionality, instead of the global event loop policy? If an instance of the loop is provided, in my opinion asyncio shouldn't care about any globals.
event_loop_policy.get_child_watcher() is undocumented as far as I can see.
The text was updated successfully, but these errors were encountered:
It is fine for other loops to watch subprocesses, as long as the main loop is running (so the main loop can notify the other ones using call_soon_threadsafe).
From the design point of view, it is up to the policy to decide how the watcher is supposed to run. So if one chooses to go explicit (i.e. set_event_loop(None)), the loop should also be attached explicitly:
Hello,
I'm the maintainer of pytest-asyncio. Pytest-asyncio allows users to block access to the global event loop, and pass the event loop explicitly; this is considered by some in the community as a best-practices approach.
However I've just received a bug report this approach doesn't work with subprocess (on Unix at least). Consider this test:
Two comments:
The text was updated successfully, but these errors were encountered: