summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-07-22 11:48:57 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-07-22 11:48:57 (GMT)
commitb7666a30933efbbb2e400e6916bba2311340fcd1 (patch)
treecee7b9199e082b014a9cbcbe749aa86591cad829 /Lib
parent8fb307cd650511ba019c4493275cb6684ad308bc (diff)
downloadcpython-b7666a30933efbbb2e400e6916bba2311340fcd1.zip
cpython-b7666a30933efbbb2e400e6916bba2311340fcd1.tar.gz
cpython-b7666a30933efbbb2e400e6916bba2311340fcd1.tar.bz2
Issue #24619: More tests; fix nits in compiler.c
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/badsyntax_async2.py2
-rw-r--r--Lib/test/test_coroutines.py9
2 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/badsyntax_async2.py b/Lib/test/badsyntax_async2.py
index 6f6f4f5..fb85e29 100644
--- a/Lib/test/badsyntax_async2.py
+++ b/Lib/test/badsyntax_async2.py
@@ -1,2 +1,2 @@
-async def foo(a:await something()):
+async def foo(a=await something()):
pass
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py
index 3ba2f23..94994e5 100644
--- a/Lib/test/test_coroutines.py
+++ b/Lib/test/test_coroutines.py
@@ -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