mirror of
https://github.com/python/cpython.git
synced 2025-08-10 03:49:18 +00:00
make lib2to3 parse async generators everywhere (GH-6588) (GH-27703)
(cherry picked from commit 149addd496
)
Co-authored-by: Zsolt Dollenstein <zsol.zsol@gmail.com>
This commit is contained in:
parent
ede1dc416d
commit
0e63776c4f
3 changed files with 17 additions and 8 deletions
|
@ -196,20 +196,27 @@ class TestAsyncAwait(GrammarTest):
|
|||
self.validate("""await = 1""")
|
||||
self.validate("""def async(): pass""")
|
||||
|
||||
def test_async_with(self):
|
||||
def test_async_for(self):
|
||||
self.validate("""async def foo():
|
||||
async for a in b: pass""")
|
||||
|
||||
self.invalid_syntax("""def foo():
|
||||
async for a in b: pass""")
|
||||
|
||||
def test_async_for(self):
|
||||
def test_async_with(self):
|
||||
self.validate("""async def foo():
|
||||
async with a: pass""")
|
||||
|
||||
self.invalid_syntax("""def foo():
|
||||
async with a: pass""")
|
||||
|
||||
def test_async_generator(self):
|
||||
self.validate(
|
||||
"""async def foo():
|
||||
return (i * 2 async for i in arange(42))"""
|
||||
)
|
||||
self.validate(
|
||||
"""def foo():
|
||||
return (i * 2 async for i in arange(42))"""
|
||||
)
|
||||
|
||||
|
||||
class TestRaiseChanges(GrammarTest):
|
||||
def test_2x_style_1(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue