Author: Armin Rigo <ar...@tunes.org> Branch: py3.5 Changeset: r86682:baa0b1b60dee Date: 2016-08-29 12:21 +0200 http://bitbucket.org/pypy/pypy/changeset/baa0b1b60dee/
Log: fix test diff --git a/pypy/interpreter/astcompiler/test/test_compiler.py b/pypy/interpreter/astcompiler/test/test_compiler.py --- a/pypy/interpreter/astcompiler/test/test_compiler.py +++ b/pypy/interpreter/astcompiler/test/test_compiler.py @@ -16,12 +16,14 @@ return codegen.compile_ast(space, ast, info) def generate_function_code(expr, space): + from pypy.interpreter.astcompiler.ast import FunctionDef p = pyparse.PythonParser(space) info = pyparse.CompileInfo("<test>", 'exec') cst = p.parse_source(expr, info) ast = astbuilder.ast_from_node(space, cst, info) function_ast = optimize.optimize_ast(space, ast.body[0], info) function_ast = ast.body[0] + assert isinstance(function_ast, FunctionDef) symbols = symtable.SymtableBuilder(space, ast, info) generator = codegen.FunctionCodeGenerator( space, 'function', function_ast, 1, symbols, info, qualname='function') @@ -1346,7 +1348,9 @@ assert ops.BINARY_POWER not in counts def test_call_function_var(self): - source = """call(*me)""" + source = """def f(): + call(*me) + """ code, blocks = generate_function_code(source, self.space) # there is a stack computation error assert blocks[0].instructions[3].arg == 0 _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit