-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-35621: Fix tests when SafeChildWatcher is expected instead of ThreadedChildWatcher #13754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is failing for me because there is no event loop in the thread that executes
|
@@ -1824,8 +1824,6 @@ def test_get_child_watcher_after_set(self): | |||
def test_get_child_watcher_thread(self): | |||
|
|||
def f(): | |||
policy.set_event_loop(policy.new_event_loop()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about:
def f():
policy.set_event_loop(policy.new_event_loop())
policy.set_child_watcher(asyncio.SafeChildWatcher())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to keep policy.set_event_loop()
in a thread but setup the watcher in the main thread (it is crucial for the test).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I tested it locally and get no failures anymore :)
Thanks @pablogsal |
|
https://bugs.python.org/issue35621