summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_itertools.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r--Lib/test/test_itertools.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index 573739f..98b8c83 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -971,6 +971,18 @@ class TestBasicOps(unittest.TestCase):
self.pickletest(proto, zip_longest("abc", "defgh", fillvalue=1))
self.pickletest(proto, zip_longest("", "defgh"))
+ def test_zip_longest_bad_iterable(self):
+ exception = TypeError()
+
+ class BadIterable:
+ def __iter__(self):
+ raise exception
+
+ with self.assertRaises(TypeError) as cm:
+ zip_longest(BadIterable())
+
+ self.assertIs(cm.exception, exception)
+
def test_bug_7244(self):
class Repeater: