8000 bpo-35621: Fix tests when SafeChildWatcher is expected instead of ThreadedChildWatcher by asvetlov · Pull Request #13754 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 3 commits into from
Jun 2, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix spaces
  • Loading branch information
asvetlov committed Jun 2, 2019
commit e930712882e44aecadc67d2e707643eacc5ecb4e
1 change: 1 addition & 0 deletions Lib/test/test_asyncio/test_unix_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -1825,6 +1825,7 @@ def test_get_child_watcher_thread(self):

def f():
policy.set_event_loop(policy.new_event_loop())
Copy link
Member

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())

Copy link
Contributor Author

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).


self.assertIsInstance(policy.get_event_loop(),
asyncio.AbstractEventLoop)
watcher = policy.get_child_watcher()
Expand Down
0