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

Method test_cycle

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

Source from the content-addressed store, hash-verified

2208 self.assertRaises(ZeroDivisionError, product, E(s))
2209
2210 def test_cycle(self):
2211 for s in ("123", "", range(1000), ('do', 1.2), range(2000,2200,5)):
2212 for g in (G, I, Ig, S, L, R):
2213 tgtlen = len(s) * 3
2214 expected = list(g(s))*3
2215 actual = list(islice(cycle(g(s)), tgtlen))
2216 self.assertEqual(actual, expected)
2217 self.assertRaises(TypeError, cycle, X(s))
2218 self.assertRaises(TypeError, cycle, N(s))
2219 self.assertRaises(ZeroDivisionError, list, cycle(E(s)))
2220
2221 def test_groupby(self):
2222 for s in (range(10), range(0), range(1000), (7,11), range(2000,2200,5)):

Callers

nothing calls this directly

Calls 8

lenFunction · 0.85
listClass · 0.85
gFunction · 0.70
XClass · 0.70
NClass · 0.70
EClass · 0.70
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected