(self)
| 530 | self.assertNotHasAttr(gen, '__await__') |
| 531 | |
| 532 | def test_func_1(self): |
| 533 | async def foo(): |
| 534 | return 10 |
| 535 | |
| 536 | f = foo() |
| 537 | self.assertIsInstance(f, types.CoroutineType) |
| 538 | self.assertTrue(bool(foo.__code__.co_flags & inspect.CO_COROUTINE)) |
| 539 | self.assertFalse(bool(foo.__code__.co_flags & inspect.CO_GENERATOR)) |
| 540 | self.assertTrue(bool(f.cr_code.co_flags & inspect.CO_COROUTINE)) |
| 541 | self.assertFalse(bool(f.cr_code.co_flags & inspect.CO_GENERATOR)) |
| 542 | self.assertEqual(run_async(f), ([], 10)) |
| 543 | |
| 544 | self.assertEqual(run_async__await__(foo()), ([], 10)) |
| 545 | |
| 546 | def bar(): pass |
| 547 | self.assertFalse(bool(bar.__code__.co_flags & inspect.CO_COROUTINE)) |
| 548 | |
| 549 | def test_func_2(self): |
| 550 | async def foo(): |
nothing calls this directly
no test coverage detected