-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
GH-124639: add back loop param to staggered_race #124700
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,6 +121,25 @@ async def coro(index): | |
self.assertIsInstance(excs[0], ValueError) | ||
self.assertIsNone(excs[1]) | ||
|
||
def test_loop_argument(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, so this is just the original test restored. See my comment #124639 (comment) for why I'm not yet approving this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, I'm not so sure there ever were tests for staggered in 3.12. What I thought I saw was probably in a different branch. :-( Sorry. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was no tests for it and still has less in main than it should |
||
loop = asyncio.new_event_loop() | ||
async def coro(): | ||
self.assertEqual(loop, asyncio.get_running_loop()) | ||
return 'coro' | ||
|
||
async def main(): | ||
winner, index, excs = await staggered_race( | ||
[coro], | ||
delay=0.1, | ||
loop=loop | ||
) | ||
|
||
self.assertEqual(winner, 'coro') | ||
self.assertEqual(index, 0) | ||
|
||
loop.run_until_complete(main()) | ||
loop.close() | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
Uh oh!
There was an error while loading. Please reload this page.