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

Method test_zip

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

Source from the content-addressed store, hash-verified

825 self.assertRaises(TypeError, next, filterfalse(range(6), range(6)))
826
827 def test_zip(self):
828 # XXX This is rather silly now that builtin zip() calls zip()...
829 ans = [(x,y) for x, y in zip('abc',count())]
830 self.assertEqual(ans, [('a', 0), ('b', 1), ('c', 2)])
831 self.assertEqual(list(zip('abc', range(6))), lzip('abc', range(6)))
832 self.assertEqual(list(zip('abcdef', range(3))), lzip('abcdef', range(3)))
833 self.assertEqual(take(3,zip('abcdef', count())), lzip('abcdef', range(3)))
834 self.assertEqual(list(zip('abcdef')), lzip('abcdef'))
835 self.assertEqual(list(zip()), lzip())
836 self.assertRaises(TypeError, zip, 3)
837 self.assertRaises(TypeError, zip, range(3), 3)
838 self.assertEqual([tuple(list(pair)) for pair in zip('abc', 'def')],
839 lzip('abc', 'def'))
840 self.assertEqual([pair for pair in zip('abc', 'def')],
841 lzip('abc', 'def'))
842
843 @support.impl_detail("tuple reuse is specific to CPython")
844 def test_zip_tuple_reuse(self):

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected