[pypy-commit] pypy py3.5-async: Complete astbuilder test for AsyncWith
raffael_t
pypy.commits at gmail.com
Sat Jul 9 15:50:52 EDT 2016
Author: Raffael Tfirst <raffael.tfirst at gmail.com>
Branch: py3.5-async
Changeset: r85634:b1818584cc50
Date: 2016-07-09 21:50 +0200
http://bitbucket.org/pypy/pypy/changeset/b1818584cc50/
Log: Complete astbuilder test for AsyncWith
diff --git a/pypy/interpreter/astcompiler/test/test_astbuilder.py b/pypy/interpreter/astcompiler/test/test_astbuilder.py
--- a/pypy/interpreter/astcompiler/test/test_astbuilder.py
+++ b/pypy/interpreter/astcompiler/test/test_astbuilder.py
@@ -1388,5 +1388,13 @@
assert asyncdef.name == 'f'
assert asyncdef.args.args == None
assert len(asyncdef.body) == 1
- expr = asyncdef.body[0]
- assert isinstance(expr, ast.AsyncWith)
+ asyncwith = asyncdef.body[0]
+ assert isinstance(asyncwith, ast.AsyncWith)
+ assert len(asyncwith.items) == 1
+ asyncitem = asyncwith.items[0]
+ assert isinstance(asyncitem, ast.withitem)
+ assert isinstance(asyncitem.context_expr, ast.Name)
+ assert isinstance(asyncitem.optional_vars, ast.Name)
+ assert len(asyncwith.body) == 1
+ assert isinstance(asyncwith.body[0], ast.Expr)
+ assert isinstance(asyncwith.body[0].value, ast.Num)
More information about the pypy-commit
mailing list