(anext)
| 918 | g.throw(MyError('val')) |
| 919 | |
| 920 | def test5(anext): |
| 921 | @types.coroutine |
| 922 | def _async_yield(v): |
| 923 | yield v * 10 |
| 924 | return (yield (v * 10 + 1)) |
| 925 | |
| 926 | async def agenfn(): |
| 927 | try: |
| 928 | await _async_yield(1) |
| 929 | except MyError: |
| 930 | return |
| 931 | yield 'aaa' |
| 932 | |
| 933 | agen = agenfn() |
| 934 | with contextlib.closing(anext(agen, "default").__await__()) as g: |
| 935 | self.assertEqual(g.send(None), 10) |
| 936 | with self.assertRaisesRegex(StopIteration, 'default'): |
| 937 | g.throw(MyError()) |
| 938 | |
| 939 | def test6(anext): |
| 940 | @types.coroutine |
nothing calls this directly
no test coverage detected