We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0027565 commit 690746cCopy full SHA for 690746c
Lib/test/test_asyncio/test_staggered.py
@@ -121,6 +121,25 @@ async def coro(index):
121
self.assertIsInstance(excs[0], ValueError)
122
self.assertIsNone(excs[1])
123
124
+ def test_loop_argument(self):
125
+ loop = asyncio.new_event_loop()
126
+ async def coro():
127
+ self.assertEqual(loop, asyncio.get_running_loop())
128
+ return 'coro'
129
+
130
+ async def main():
131
+ winner, index, excs = await staggered_race(
132
+ [coro],
133
+ delay=0.1,
134
+ loop=loop
135
+ )
136
137
+ self.assertEqual(winner, 'coro')
138
+ self.assertEqual(index, 0)
139
140
+ loop.run_until_complete(main())
141
+ loop.close()
142
143
144
if __name__ == "__main__":
145
unittest.main()
0 commit comments