MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_func_17

Method test_func_17

Lib/test/test_coroutines.py:826–847  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

coroutineFunction · 0.85
assertRaisesRegexMethod · 0.80
sendMethod · 0.45
throwMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected