[Python-checkins] python/dist/src/Lib/test test_itertools.py, 1.16, 1.17

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Thu Aug 7 23:10:43 EDT 2003


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv14440/Lib/test

Modified Files:
	test_itertools.py 
Log Message:
Modified itertools.izip() to match the behavior of __builtin__.zip()
which can now take zero arguments.



Index: test_itertools.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** test_itertools.py	8 Aug 2003 04:33:19 -0000	1.16
--- test_itertools.py	8 Aug 2003 05:10:41 -0000	1.17
***************
*** 88,92 ****
          self.assertEqual(take(3,izip('abcdef', count())), zip('abcdef', range(3)))
          self.assertEqual(list(izip('abcdef')), zip('abcdef'))
!         self.assertRaises(TypeError, izip)
          self.assertRaises(TypeError, izip, 3)
          self.assertRaises(TypeError, izip, range(3), 3)
--- 88,92 ----
          self.assertEqual(take(3,izip('abcdef', count())), zip('abcdef', range(3)))
          self.assertEqual(list(izip('abcdef')), zip('abcdef'))
!         self.assertEqual(list(izip()), zip())
          self.assertRaises(TypeError, izip, 3)
          self.assertRaises(TypeError, izip, range(3), 3)
***************
*** 200,203 ****
--- 200,205 ----
  
      def test_StopIteration(self):
+         self.assertRaises(StopIteration, izip().next)
+ 
          for f in (chain, cycle, izip):
              self.assertRaises(StopIteration, f([]).next)
***************
*** 540,543 ****
--- 542,548 ----
  >>> no(lambda x: x%2==0, [1, 2, 5, 9])
  False
+ 
+ >>> quantify(lambda x: x%2==0, xrange(99))
+ 50
  
  >>> list(window('abc'))





More information about the Python-checkins mailing list