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

Method test_compress

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

Source from the content-addressed store, hash-verified

2241 self.assertRaises(ZeroDivisionError, list, chain(E(s)))
2242
2243 def test_compress(self):
2244 for s in ("123", "", range(1000), ('do', 1.2), range(2000,2200,5)):
2245 n = len(s)
2246 for g in (G, I, Ig, S, L, R):
2247 self.assertEqual(list(compress(g(s), repeat(1))), list(g(s)))
2248 self.assertRaises(TypeError, compress, X(s), repeat(1))
2249 self.assertRaises(TypeError, compress, N(s), repeat(1))
2250 self.assertRaises(ZeroDivisionError, list, compress(E(s), repeat(1)))
2251
2252 def test_product(self):
2253 for s in ("123", "", range(1000), ('do', 1.2), range(2000,2200,5)):

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected