diff options
author | Raymond Hettinger <python@rcn.com> | 2008-02-28 22:30:42 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2008-02-28 22:30:42 (GMT) |
commit | 05bf6338b810d01e7bba5503fbd01f2b6216ca59 (patch) | |
tree | f21ead02bb2212f734869ce7029fb3a9601154e6 /Lib/test | |
parent | 03dc56cd171b116b22d2f1f44de6d77f6ff6850e (diff) | |
download | cpython-05bf6338b810d01e7bba5503fbd01f2b6216ca59.zip cpython-05bf6338b810d01e7bba5503fbd01f2b6216ca59.tar.gz cpython-05bf6338b810d01e7bba5503fbd01f2b6216ca59.tar.bz2 |
Have itertools.chain() consume its inputs lazily instead of building a tuple of iterators at the outset.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_itertools.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index 79c4b3a..41e9362 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -50,7 +50,7 @@ class TestBasicOps(unittest.TestCase): self.assertEqual(list(chain('abc')), list('abc')) self.assertEqual(list(chain('')), []) self.assertEqual(take(4, chain('abc', 'def')), list('abcd')) - self.assertRaises(TypeError, chain, 2, 3) + self.assertRaises(TypeError, list,chain(2, 3)) def test_combinations(self): self.assertRaises(TypeError, combinations, 'abc') # missing r argument @@ -670,7 +670,7 @@ class TestVariousIteratorArgs(unittest.TestCase): for g in (G, I, Ig, S, L, R): 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, chain, X(s)) + self.assertRaises(TypeError, list, chain(X(s))) self.assertRaises(TypeError, list, chain(N(s))) self.assertRaises(ZeroDivisionError, list, chain(E(s))) |