MCPcopy Index your code
hub / github.com/python/cpython / test_double_await

Method test_double_await

Lib/test/test_asyncio/test_pep492.py:190–208  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

188 self.loop.run_until_complete(runner())
189
190 def test_double_await(self):
191 async def afunc():
192 await asyncio.sleep(0.1)
193
194 async def runner():
195 coro = afunc()
196 t = self.loop.create_task(coro)
197 try:
198 await asyncio.sleep(0)
199 await coro
200 finally:
201 t.cancel()
202
203 self.loop.set_debug(True)
204 with self.assertRaises(
205 RuntimeError,
206 msg='coroutine is being awaited already'):
207
208 self.loop.run_until_complete(runner())
209
210
211if __name__ == '__main__':

Callers

nothing calls this directly

Calls 4

runnerFunction · 0.85
set_debugMethod · 0.45
assertRaisesMethod · 0.45
run_until_completeMethod · 0.45

Tested by

no test coverage detected