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

Method test_stopiteration_error

Lib/test/test_generators.py:577–585  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

575 gen.throw(TypeError, TypeError(24), None)
576
577 def test_stopiteration_error(self):
578 # See also PEP 479.
579
580 def gen():
581 raise StopIteration
582 yield
583
584 with self.assertRaisesRegex(RuntimeError, 'raised StopIteration'):
585 next(gen())
586
587 def test_tutorial_stopiteration(self):
588 # Raise StopIteration" stops the generator too:

Callers

nothing calls this directly

Calls 3

nextFunction · 0.85
assertRaisesRegexMethod · 0.80
genFunction · 0.70

Tested by

no test coverage detected