Author: Carl Friedrich Bolz-Tereick <[email protected]>
Branch: py3.6-wordcode
Changeset: r94587:4b345ab7bd57
Date: 2018-05-14 15:54 +0200
http://bitbucket.org/pypy/pypy/changeset/4b345ab7bd57/
Log: fix test_compiler
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
@@ -73,8 +73,8 @@
# for now, we compile evalexpr with CPython's compiler but run
# it with our own interpreter to extract the data from w_dict
space = self.space
- pyco_expr = space.createcompiler().compile(evalexpr, '<evalexpr>',
'eval')
- w_res = pyco_expr.exec_host_bytecode(w_dict, w_dict)
+ pyco_expr = space.createcompiler().compile(evalexpr, '<evalexpr>',
'eval', 0)
+ w_res = space.exec_(pyco_expr, w_dict, w_dict)
res = space.str_w(space.repr(w_res))
expected_repr = self.get_py3_repr(expected)
if isinstance(expected, float):
@@ -1207,12 +1207,12 @@
yield self.st, """z=f'{f"{0}"*3}'""", 'z', '000'
def test_fstring_error(self):
- raises(SyntaxError, self.run, "f'{}'")
- raises(SyntaxError, self.run, "f'{ \t }'")
- raises(SyntaxError, self.run, "f'{5#}'")
- raises(SyntaxError, self.run, "f'{5)#}'")
- raises(SyntaxError, self.run, "f'''{5)\n#}'''")
- raises(SyntaxError, self.run, "f'\\x'")
+ py.test.raises(SyntaxError, self.run, "f'{}'")
+ py.test.raises(SyntaxError, self.run, "f'{ \t }'")
+ py.test.raises(SyntaxError, self.run, "f'{5#}'")
+ py.test.raises(SyntaxError, self.run, "f'{5)#}'")
+ py.test.raises(SyntaxError, self.run, "f'''{5)\n#}'''")
+ py.test.raises(SyntaxError, self.run, "f'\\x'")
def test_fstring_encoding(self):
src = """# -*- coding: latin-1 -*-\nz=ord(f'{"\xd8"}')\n"""
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit