mirror of
https://github.com/python/cpython.git
synced 2025-11-01 22:21:35 +00:00
[3.13] GH-135171: Roll back all fixes for GH-127682 as they are not suitable for 3.13 (#135390)
This commit is contained in:
parent
5f5b173cc7
commit
6ae51582a1
7 changed files with 30 additions and 72 deletions
|
|
@ -750,28 +750,6 @@ def iter_raises():
|
|||
self.assertEqual(f.line[f.colno - indent : f.end_colno - indent],
|
||||
expected)
|
||||
|
||||
def test_only_calls_dunder_iter_once(self):
|
||||
|
||||
class Iterator:
|
||||
|
||||
def __init__(self):
|
||||
self.val = 0
|
||||
|
||||
def __next__(self):
|
||||
if self.val == 2:
|
||||
raise StopIteration
|
||||
self.val += 1
|
||||
return self.val
|
||||
|
||||
# No __iter__ method
|
||||
|
||||
class C:
|
||||
|
||||
def __iter__(self):
|
||||
return Iterator()
|
||||
|
||||
self.assertEqual([1,2], [i for i in C()])
|
||||
|
||||
__test__ = {'doctests' : doctests}
|
||||
|
||||
def load_tests(loader, tests, pattern):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue