MCPcopy Index your code
hub / github.com/python/cpython / test_stopiteration_error

Method test_stopiteration_error

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

assertRaisesRegexMethod · 0.80
genFunction · 0.70

Tested by

no test coverage detected