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

Method test_starmap

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

Source from the content-addressed store, hash-verified

1153 self.assertRaises(TypeError, next, map(onearg, [4], [5]))
1154
1155 def test_starmap(self):
1156 self.assertEqual(list(starmap(operator.pow, zip(range(3), range(1,7)))),
1157 [0**1, 1**2, 2**3])
1158 self.assertEqual(take(3, starmap(operator.pow, zip(count(), count(1)))),
1159 [0**1, 1**2, 2**3])
1160 self.assertEqual(list(starmap(operator.pow, [])), [])
1161 self.assertEqual(list(starmap(operator.pow, [iter([4,5])])), [4**5])
1162 self.assertRaises(TypeError, list, starmap(operator.pow, [None]))
1163 self.assertRaises(TypeError, starmap)
1164 self.assertRaises(TypeError, starmap, operator.pow, [(4,5)], 'extra')
1165 self.assertRaises(TypeError, next, starmap(10, [(4,5)]))
1166 self.assertRaises(ValueError, next, starmap(errfunc, [(4,5)]))
1167 self.assertRaises(TypeError, next, starmap(onearg, [(4,5)]))
1168
1169 def test_islice(self):
1170 for args in [ # islice(args) should agree with range(args)

Callers

nothing calls this directly

Calls 5

listClass · 0.85
takeFunction · 0.85
countFunction · 0.85
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected