(self)
| 824 | |
| 825 | @unittest.expectedFailure # TODO: RUSTPYTHON; StopIteration |
| 826 | def test_func_17(self): |
| 827 | # See http://bugs.python.org/issue25887 for details |
| 828 | |
| 829 | async def coroutine(): |
| 830 | return 'spam' |
| 831 | |
| 832 | coro = coroutine() |
| 833 | with self.assertRaisesRegex(StopIteration, 'spam'): |
| 834 | coro.send(None) |
| 835 | |
| 836 | with self.assertRaisesRegex(RuntimeError, |
| 837 | 'cannot reuse already awaited coroutine'): |
| 838 | coro.send(None) |
| 839 | |
| 840 | with self.assertRaisesRegex(RuntimeError, |
| 841 | 'cannot reuse already awaited coroutine'): |
| 842 | coro.throw(Exception('wat')) |
| 843 | |
| 844 | # Closing a coroutine shouldn't raise any exception even if it's |
| 845 | # already closed/exhausted (similar to generators) |
| 846 | coro.close() |
| 847 | coro.close() |
| 848 | |
| 849 | def test_func_18(self): |
| 850 | # See http://bugs.python.org/issue25887 for details |
nothing calls this directly
no test coverage detected