Fix #139: newlines in async for comprehension

This commit is contained in:
Jocelyn Boullier
2020-06-28 13:26:19 +02:00
parent 7e0586b0b9
commit 88874a5a9f
4 changed files with 39 additions and 1 deletions

View File

@@ -87,6 +87,39 @@ def test_async_for(works_ge_py35):
works_ge_py35.parse("async def foo():\n async for a in b: pass")
@pytest.mark.parametrize("body", [
"""[1 async for a in b
]""",
"""[1 async
for a in b
]""",
"""[
1
async for a in b
]""",
"""[
1
async for a
in b
]""",
"""[
1
async
for
a
in
b
]""",
""" [
1 async for a in b
]""",
])
def test_async_for_comprehension_newline(works_ge_py36, body):
# Issue #139
works_ge_py36.parse("""async def foo():
{}""".format(body))
def test_async_with(works_ge_py35):
works_ge_py35.parse("async def foo():\n async with a: pass")