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

Method test_map

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

Source from the content-addressed store, hash-verified

2311 self.assertRaises(ZeroDivisionError, list, zip_longest(E(s)))
2312
2313 def test_map(self):
2314 for s in (range(10), range(0), range(100), (7,11), range(20,50,5)):
2315 for g in (G, I, Ig, S, L, R):
2316 self.assertEqual(list(map(onearg, g(s))),
2317 [onearg(x) for x in g(s)])
2318 self.assertEqual(list(map(operator.pow, g(s), g(s))),
2319 [x**x for x in g(s)])
2320 self.assertRaises(TypeError, map, onearg, X(s))
2321 self.assertRaises(TypeError, map, onearg, N(s))
2322 self.assertRaises(ZeroDivisionError, list, map(onearg, E(s)))
2323
2324 def test_islice(self):
2325 for s in ("12345", "", range(1000), ('do', 1.2), range(2000,2200,5)):

Callers

nothing calls this directly

Calls 8

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