(self)
| 792 | |
| 793 | @unittest.expectedFailure # TODO: RUSTPYTHON; StopIteration |
| 794 | def test_func_16(self): |
| 795 | # See http://bugs.python.org/issue25887 for details |
| 796 | |
| 797 | @types.coroutine |
| 798 | def nop(): |
| 799 | yield |
| 800 | async def send(): |
| 801 | await nop() |
| 802 | return 'spam' |
| 803 | async def read(coro): |
| 804 | await nop() |
| 805 | return await coro |
| 806 | |
| 807 | spammer = send() |
| 808 | |
| 809 | reader = read(spammer) |
| 810 | reader.send(None) |
| 811 | reader.send(None) |
| 812 | with self.assertRaisesRegex(Exception, 'ham'): |
| 813 | reader.throw(Exception('ham')) |
| 814 | |
| 815 | reader = read(spammer) |
| 816 | reader.send(None) |
| 817 | with self.assertRaisesRegex(RuntimeError, |
| 818 | 'cannot reuse already awaited coroutine'): |
| 819 | reader.send(None) |
| 820 | |
| 821 | with self.assertRaisesRegex(RuntimeError, |
| 822 | 'cannot reuse already awaited coroutine'): |
| 823 | reader.throw(Exception('wat')) |
| 824 | |
| 825 | @unittest.expectedFailure # TODO: RUSTPYTHON; StopIteration |
| 826 | def test_func_17(self): |
nothing calls this directly
no test coverage detected