From: Jeong YunWon <69878+youknowone@users.noreply.github.com> Date: Tue, 14 Jun 2022 20:45:50 +0000 (+0900) Subject: gh-93814: Add infinite test for itertools.chain.from_iterable (GH-93815) X-Git-Tag: v3.12.0a1~1257 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=274769c61c5f3f3d2d749824cbed26e15813ce14;p=thirdparty%2FPython%2Fcpython.git gh-93814: Add infinite test for itertools.chain.from_iterable (GH-93815) fix #93814 Automerge-Triggered-By: GH:rhettinger --- diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index 238afbbd883d..f469bfe185e6 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -180,6 +180,7 @@ class TestBasicOps(unittest.TestCase): self.assertEqual(list(chain.from_iterable([''])), []) self.assertEqual(take(4, chain.from_iterable(['abc', 'def'])), list('abcd')) self.assertRaises(TypeError, list, chain.from_iterable([2, 3])) + self.assertEqual(list(islice(chain.from_iterable(repeat(range(5))), 2)), [0, 1]) def test_chain_reducible(self): for oper in [copy.deepcopy] + picklecopiers: