-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
GH-100192: add more asyncio
subprocess tests
#100194
Conversation
task = asyncio.create_task(proc.wait()) | ||
await asyncio.sleep(0) | ||
self.assertEqual(task.result(), proc.returncode) |
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.
Why not await task
instead of sleep(0)
and task.result()
? At this point we already know the process has exited, since the returncode is 0 on the previous line.
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.
At this point we already know the process has exited, since the returncode is 0 on the previous line.
Yes, awaiting can take more than one cycle but we are checking that wait will be done immediately so using sleep(0)
trick.
|
|
|
asyncio
subprocess #100192