]> granicus.if.org Git - python/commitdiff
Fix failing itertools test: since revision 61118,
authorMark Dickinson <dickinsm@gmail.com>
Sat, 1 Mar 2008 02:27:46 +0000 (02:27 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sat, 1 Mar 2008 02:27:46 +0000 (02:27 +0000)
itertools.chain consumes its arguments lazily,
so chain(non_iterable) doesn't raise TypeError
until the first call to__next__.  The test has
been changed to reflect this.

Committing this in during the code freeze; the
checkin was approved by Barry.

Lib/test/test_itertools.py

index b1c1033f422f54797d17dd87557a7e56fa7e5c57..44762eb49dd10c4d0a3bd296570709f706f5af79 100644 (file)
@@ -695,7 +695,7 @@ class TestVariousIteratorArgs(unittest.TestCase):
                 self.assertEqual(list(chain(g(s))), list(g(s)))
                 self.assertEqual(list(chain(g(s), g(s))), list(g(s))+list(g(s)))
             self.assertRaises(TypeError, list, chain(X(s)))
-            self.assertRaises(TypeError, chain, N(s))
+            self.assertRaises(TypeError, list, chain(N(s)))
             self.assertRaises(ZeroDivisionError, list, chain(E(s)))
 
     def test_product(self):