(self)
| 228 | to_list(gen()) |
| 229 | |
| 230 | def test_async_gen_exception_04(self): |
| 231 | async def gen(): |
| 232 | await awaitable() |
| 233 | yield 123 |
| 234 | 1 / 0 |
| 235 | |
| 236 | g = gen() |
| 237 | ai = g.__aiter__() |
| 238 | an = ai.__anext__() |
| 239 | self.assertEqual(an.__next__(), ('result',)) |
| 240 | |
| 241 | try: |
| 242 | an.__next__() |
| 243 | except StopIteration as ex: |
| 244 | self.assertEqual(ex.args[0], 123) |
| 245 | else: |
| 246 | self.fail('StopIteration was not raised') |
| 247 | |
| 248 | with self.assertRaises(ZeroDivisionError): |
| 249 | ai.__anext__().__next__() |
| 250 | |
| 251 | def test_async_gen_exception_05(self): |
| 252 | async def gen(): |
nothing calls this directly
no test coverage detected