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

Method test_compress

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

Source from the content-addressed store, hash-verified

2193 self.assertRaises(ZeroDivisionError, list, chain(E(s)))
2194
2195 def test_compress(self):
2196 for s in ("123", "", range(1000), ('do', 1.2), range(2000,2200,5)):
2197 n = len(s)
2198 for g in (G, I, Ig, S, L, R):
2199 self.assertEqual(list(compress(g(s), repeat(1))), list(g(s)))
2200 self.assertRaises(TypeError, compress, X(s), repeat(1))
2201 self.assertRaises(TypeError, compress, N(s), repeat(1))
2202 self.assertRaises(ZeroDivisionError, list, compress(E(s), repeat(1)))
2203
2204 def test_product(self):
2205 for s in ("123", "", range(1000), ('do', 1.2), range(2000,2200,5)):

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected