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

Method test_stop_sequence

Lib/test/test_iter.py:412–418  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

410
411 # Test for StopIteration from __getitem__
412 def test_stop_sequence(self):
413 class MySequenceClass(SequenceClass):
414 def __getitem__(self, i):
415 if i == 10:
416 raise StopIteration
417 return SequenceClass.__getitem__(self, i)
418 self.check_for_loop(MySequenceClass(20), list(range(10)), pickle=False)
419
420 # Test a big range
421 def test_iter_big_range(self):

Callers

nothing calls this directly

Calls 3

check_for_loopMethod · 0.95
MySequenceClassClass · 0.85
listClass · 0.85

Tested by

no test coverage detected