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

Method test_iter_function_stop

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

Source from the content-addressed store, hash-verified

342
343 # Test two-argument iter() with function that raises StopIteration
344 def test_iter_function_stop(self):
345 def spam(state=[0]):
346 i = state[0]
347 if i == 10:
348 raise StopIteration
349 state[0] = i+1
350 return i
351 self.check_iterator(iter(spam, 20), list(range(10)), pickle=False)
352
353 def test_iter_function_concealing_reentrant_exhaustion(self):
354 # gh-101892: Test two-argument iter() with a function that

Callers

nothing calls this directly

Calls 2

check_iteratorMethod · 0.95
listClass · 0.85

Tested by

no test coverage detected