gh-123142: fix too wide source location of GET_ITER/GET_AITER (#123420)

This commit is contained in:
Irit Katriel 2024-08-28 17:11:52 +01:00 committed by GitHub
parent 40fff90ae3
commit 61bef6245c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 40 additions and 9 deletions

View file

@ -730,8 +730,15 @@ class ListComprehensionTest(unittest.TestCase):
except Exception as e:
return e
def iter_raises():
try:
[x for x in BrokenIter(iter_raises=True)]
except Exception as e:
return e
for func, expected in [(init_raises, "BrokenIter(init_raises=True)"),
(next_raises, "BrokenIter(next_raises=True)"),
(iter_raises, "BrokenIter(iter_raises=True)"),
]:
with self.subTest(func):
exc = func()