mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Issue #24619: More tests; fix nits in compiler.c
This commit is contained in:
parent
8fb307cd65
commit
b7666a3093
4 changed files with 9 additions and 9 deletions
|
@ -205,12 +205,14 @@ class AsyncBadSyntaxTest(unittest.TestCase):
|
|||
return lambda a: await
|
||||
""",
|
||||
|
||||
"""async def foo(a: await b):
|
||||
"""await a()""",
|
||||
|
||||
"""async def foo(a=await b):
|
||||
pass
|
||||
""",
|
||||
|
||||
"""def baz():
|
||||
async def foo(a: await b):
|
||||
async def foo(a=await b):
|
||||
pass
|
||||
""",
|
||||
|
||||
|
@ -271,10 +273,9 @@ class AsyncBadSyntaxTest(unittest.TestCase):
|
|||
pass\nawait a
|
||||
"""]
|
||||
|
||||
ns = {}
|
||||
for code in samples:
|
||||
with self.subTest(code=code), self.assertRaises(SyntaxError):
|
||||
exec(code, ns, ns)
|
||||
compile(code, "<test>", "exec")
|
||||
|
||||
def test_goodsyntax_1(self):
|
||||
# Tests for issue 24619
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue