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

Method test_chain

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

Source from the content-addressed store, hash-verified

2232 self.assertRaises(ZeroDivisionError, list, batched(E2(s), 4))
2233
2234 def test_chain(self):
2235 for s in ("123", "", range(1000), ('do', 1.2), range(2000,2200,5)):
2236 for g in (G, I, Ig, S, L, R):
2237 self.assertEqual(list(chain(g(s))), list(g(s)))
2238 self.assertEqual(list(chain(g(s), g(s))), list(g(s))+list(g(s)))
2239 self.assertRaises(TypeError, list, chain(X(s)))
2240 self.assertRaises(TypeError, list, chain(N(s)))
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)):

Callers

nothing calls this directly

Calls 8

listClass · 0.85
chainFunction · 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