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

Method assert_stop_iteration

Lib/test/test_yield_from.py:1059–1063  ·  view source on GitHub ↗
(self, iterator)

Source from the content-addressed store, hash-verified

1057class TestInterestingEdgeCases(unittest.TestCase):
1058
1059 def assert_stop_iteration(self, iterator):
1060 with self.assertRaises(StopIteration) as caught:
1061 next(iterator)
1062 self.assertIsNone(caught.exception.value)
1063 self.assertIsNone(caught.exception.__context__)
1064
1065 def assert_generator_raised_stop_iteration(self):
1066 return self.assertRaisesRegex(RuntimeError, r"^generator raised StopIteration$")

Calls 2

assertIsNoneMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected