We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c443507 commit ad2d676Copy full SHA for ad2d676
Lib/test/test_unicode.py
@@ -185,6 +185,18 @@ def test_iterators(self):
185
self.assertEqual(next(it), "\u3333")
186
self.assertRaises(StopIteration, next, it)
187
188
+ def test_iterators_invocation(self):
189
+ cases = [type(iter('abc')), type(iter('🚀'))]
190
+ for cls in cases:
191
+ with self.subTest(cls=cls):
192
+ self.assertRaises(TypeError, cls)
193
+
194
+ def test_iteration(self):
195
+ cases = ['abc', '🚀🚀🚀', "\u1111\u2222\u3333"]
196
+ for case in cases:
197
+ with self.subTest(string=case):
198
+ self.assertEqual((*case,), (*iter(case),))
199
200
def test_count(self):
201
string_tests.CommonTest.test_count(self)
202
# check mixed argument types
0 commit comments