Skip to content

Commit 9769a48

Browse files
h-joocopybara-github
authored andcommitted
test
PiperOrigin-RevId: 752776365
1 parent cbab356 commit 9769a48

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pytype/tests/test_async_generators.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,20 @@ async def gen():
406406
x4: Coroutine[Any, Any, None] = gen().aclose()
407407
""")
408408

409+
@test_utils.skipBeforePy((3, 11), "New in 3.11")
410+
def test_async_for(self):
411+
self.Check("""
412+
async def iterate(num):
413+
try:
414+
async for s in range(num): # pytype: disable=attribute-error
415+
if s > 3:
416+
yield ''
417+
except ValueError as e:
418+
yield ''
419+
yield ''
420+
""")
421+
422+
409423

410424
if __name__ == "__main__":
411425
test_base.main()

0 commit comments

Comments
 (0)