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

Method test_async_gen_api_01

Lib/test/test_asyncgen.py:552–572  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

550 gc_collect()
551
552 def test_async_gen_api_01(self):
553 async def gen():
554 yield 123
555
556 g = gen()
557
558 self.assertEqual(g.__name__, 'gen')
559 g.__name__ = '123'
560 self.assertEqual(g.__name__, '123')
561
562 self.assertIn('.gen', g.__qualname__)
563 g.__qualname__ = '123'
564 self.assertEqual(g.__qualname__, '123')
565
566 self.assertIsNone(g.ag_await)
567 self.assertIsInstance(g.ag_frame, types.FrameType)
568 self.assertFalse(g.ag_running)
569 self.assertIsInstance(g.ag_code, types.CodeType)
570 aclose = g.aclose()
571 self.assertTrue(inspect.isawaitable(aclose))
572 aclose.close()
573
574 def test_async_gen_asend_close_runtime_error(self):
575 import types

Callers

nothing calls this directly

Calls 9

assertInMethod · 0.80
assertIsNoneMethod · 0.80
assertIsInstanceMethod · 0.80
assertFalseMethod · 0.80
assertTrueMethod · 0.80
genFunction · 0.70
assertEqualMethod · 0.45
acloseMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected