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

Method test_await_5

Lib/test/test_coroutines.py:1002–1013  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1000 self.assertEqual(run_async(foo()), ([], 42))
1001
1002 def test_await_5(self):
1003 class Awaitable:
1004 def __await__(self):
1005 return
1006
1007 async def foo():
1008 return (await Awaitable())
1009
1010 with self.assertRaisesRegex(
1011 TypeError, "__await__.*must return an iterator, not"):
1012
1013 run_async(foo())
1014
1015 def test_await_6(self):
1016 class Awaitable:

Callers

nothing calls this directly

Calls 3

run_asyncFunction · 0.85
assertRaisesRegexMethod · 0.80
fooFunction · 0.70

Tested by

no test coverage detected