()
| 565 | |
| 566 | |
| 567 | def test_proxy_aiter(): |
| 568 | class Example: |
| 569 | value = 3 |
| 570 | |
| 571 | def __aiter__(self): |
| 572 | return self |
| 573 | |
| 574 | async def __anext__(self): |
| 575 | if self.value: |
| 576 | self.value -= 1 |
| 577 | return self.value |
| 578 | |
| 579 | raise StopAsyncIteration |
| 580 | |
| 581 | _, p = _make_proxy(Example()) |
| 582 | |
| 583 | async def main(): |
| 584 | out = [] |
| 585 | |
| 586 | async for v in p: |
| 587 | out.append(v) |
| 588 | |
| 589 | return out |
| 590 | |
| 591 | out = asyncio.run(main()) |
| 592 | assert out == [2, 1, 0] |
| 593 | |
| 594 | |
| 595 | def test_proxy_async_context_manager(): |
nothing calls this directly
no test coverage detected