Author: Raffael Tfirst <[email protected]>
Branch: py3.5-async
Changeset: r86008:3f09fda522df
Date: 2016-08-03 21:50 +0200
http://bitbucket.org/pypy/pypy/changeset/3f09fda522df/
Log: More parser tests for async and await
diff --git a/pypy/interpreter/pyparser/test/test_pyparse.py
b/pypy/interpreter/pyparser/test/test_pyparse.py
--- a/pypy/interpreter/pyparser/test/test_pyparse.py
+++ b/pypy/interpreter/pyparser/test/test_pyparse.py
@@ -170,6 +170,7 @@
def test_async_await(self):
self.parse("async def coro(): await func")
+ py.test.raises(SyntaxError, self.parse, 'await x')
#Test as var and func name
self.parse("async = 1")
self.parse("await = 1")
@@ -178,10 +179,14 @@
self.parse("""async def foo():
async for a in b:
pass""")
+ py.test.raises(SyntaxError, self.parse, 'def foo(): async for a in b:
pass')
#async with
self.parse("""async def foo():
async with a:
pass""")
+ py.test.raises(SyntaxError, self.parse, 'def foo(): async with a:
pass')
+
+
class TestPythonParserWithSpace:
diff --git a/pypy/interpreter/test/test_syntax.py
b/pypy/interpreter/test/test_syntax.py
--- a/pypy/interpreter/test/test_syntax.py
+++ b/pypy/interpreter/test/test_syntax.py
@@ -100,12 +100,6 @@
async def foo():
await await fut
- await x
-
- def foo(): async for a in b: pass
-
- def foo(): async with a: pass
-
""")
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit