(self)
| 103 | |
| 104 | @coroutine_test |
| 105 | async def test_iter_errback_bad(self): |
| 106 | async def iterbad() -> AsyncGenerator[int, None]: |
| 107 | for x in range(10): |
| 108 | if x == 5: |
| 109 | 1 / 0 |
| 110 | yield x |
| 111 | |
| 112 | errors = [] |
| 113 | out = await collect_asyncgen(aiter_errback(iterbad(), errors.append)) |
| 114 | assert out == [0, 1, 2, 3, 4] |
| 115 | assert len(errors) == 1 |
| 116 | assert isinstance(errors[0].value, ZeroDivisionError) |
| 117 | |
| 118 | |
| 119 | class TestAsyncDefTestsuite: |
nothing calls this directly
no test coverage detected