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

Method test_StopIteration

Lib/test/test_itertools.py:1393–1414  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1391 thread.join()
1392
1393 def test_StopIteration(self):
1394 self.assertRaises(StopIteration, next, zip())
1395
1396 for f in (chain, cycle, zip, groupby):
1397 self.assertRaises(StopIteration, next, f([]))
1398 self.assertRaises(StopIteration, next, f(StopNow()))
1399
1400 self.assertRaises(StopIteration, next, islice([], None))
1401 self.assertRaises(StopIteration, next, islice(StopNow(), None))
1402
1403 p, q = tee([])
1404 self.assertRaises(StopIteration, next, p)
1405 self.assertRaises(StopIteration, next, q)
1406 p, q = tee(StopNow())
1407 self.assertRaises(StopIteration, next, p)
1408 self.assertRaises(StopIteration, next, q)
1409
1410 self.assertRaises(StopIteration, next, repeat(None, 0))
1411
1412 for f in (filter, filterfalse, map, takewhile, dropwhile, starmap):
1413 self.assertRaises(StopIteration, next, f(lambda x:x, []))
1414 self.assertRaises(StopIteration, next, f(lambda x:x, StopNow()))
1415
1416 @support.cpython_only
1417 def test_combinations_result_gc(self):

Callers

nothing calls this directly

Calls 4

StopNowClass · 0.85
repeatFunction · 0.85
fFunction · 0.70
assertRaisesMethod · 0.45

Tested by

no test coverage detected