[Python-checkins] gh-93814: Add infinite test for itertools.chain.from_iterable (GH-93815)
miss-islington
webhook-mailer at python.org
Tue Jun 14 16:46:00 EDT 2022
https://github.com/python/cpython/commit/274769c61c5f3f3d2d749824cbed26e15813ce14
commit: 274769c61c5f3f3d2d749824cbed26e15813ce14
branch: main
author: Jeong YunWon <69878+youknowone at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-06-14T13:45:50-07:00
summary:
gh-93814: Add infinite test for itertools.chain.from_iterable (GH-93815)
fix #93814
Automerge-Triggered-By: GH:rhettinger
files:
M Lib/test/test_itertools.py
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index 238afbbd883d3..f469bfe185e65 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -180,6 +180,7 @@ def test_chain_from_iterable(self):
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:
More information about the Python-checkins
mailing list