()
| 640 | def _check_async_iterator_anext(self, ait_class, anext): |
| 641 | g = ait_class() |
| 642 | async def consume(): |
| 643 | results = [] |
| 644 | results.append(await anext(g)) |
| 645 | results.append(await anext(g)) |
| 646 | results.append(await anext(g, 'buckle my shoe')) |
| 647 | return results |
| 648 | res = self.loop.run_until_complete(consume()) |
| 649 | self.assertEqual(res, [1, 2, 'buckle my shoe']) |
| 650 | with self.assertRaises(StopAsyncIteration): |