[Python-checkins] python/dist/src/Lib/test test_itertools.py, 1.28, 1.29

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Tue Feb 10 04:25:43 EST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29235/Lib/test

Modified Files:
	test_itertools.py 
Log Message:
Give itertools.repeat() a length method.



Index: test_itertools.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** test_itertools.py	20 Jan 2004 20:04:31 -0000	1.28
--- test_itertools.py	10 Feb 2004 09:25:40 -0000	1.29
***************
*** 608,611 ****
--- 608,617 ----
              self.assertRaises(ZeroDivisionError, list, tee(E(s))[0])
  
+ class LengthTransparency(unittest.TestCase):
+ 
+     def test_repeat(self):
+         self.assertEqual(len(repeat(None, 50)), 50)
+         self.assertRaises(TypeError, len, repeat(None))
+ 
  class RegressionTests(unittest.TestCase):
  
***************
*** 827,831 ****
  def test_main(verbose=None):
      test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC,
!                     RegressionTests)
      test_support.run_unittest(*test_classes)
  
--- 833,837 ----
  def test_main(verbose=None):
      test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC,
!                     RegressionTests, LengthTransparency)
      test_support.run_unittest(*test_classes)
  




More information about the Python-checkins mailing list