(self)
| 565 | |
| 566 | @unittest.expectedFailure # TODO: RUSTPYTHON; RuntimeError: coroutine raised StopIteration |
| 567 | def test_func_4(self): |
| 568 | async def foo(): |
| 569 | raise StopIteration |
| 570 | coro = foo() |
| 571 | |
| 572 | check = lambda: self.assertRaisesRegex( |
| 573 | TypeError, "'coroutine' object is not iterable") |
| 574 | |
| 575 | with check(): |
| 576 | list(coro) |
| 577 | |
| 578 | with check(): |
| 579 | tuple(coro) |
| 580 | |
| 581 | with check(): |
| 582 | sum(coro) |
| 583 | |
| 584 | with check(): |
| 585 | iter(coro) |
| 586 | |
| 587 | with check(): |
| 588 | for i in coro: |
| 589 | pass |
| 590 | |
| 591 | with check(): |
| 592 | [i for i in coro] |
| 593 | |
| 594 | coro.close() |
| 595 | |
| 596 | @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: TypeError not raised |
| 597 | def test_func_5(self): |