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