pypy/interpreter/test/test_compiler.py::TestPythonAstCompiler::()::test_future_error_offset
self = <pypy.interpreter.test.test_compiler.TestPythonAstCompiler instance at 0x0000000016f237e0>
def test_future_error_offset(self):
space = self.space
with pytest.raises(OperationError) as excinfo:
self.compiler.compile("from __future__ import bogus", "tmp", "exec", 0)
ex = excinfo.value
assert ex.match(space, space.w_SyntaxError)
ex.normalize_exception(space)
w_exc = ex.get_w_value(space)
> assert space.int_w(w_exc.w_offset) == 1
E assert 24 == 1
E + where 24 = <bound method StdObjSpace.int_w of StdObjSpace>(W_IntObject(24))
E + where <bound method StdObjSpace.int_w of StdObjSpace> = StdObjSpace.int_w
E + and W_IntObject(24) = W_IntObject(24)
E + where W_IntObject(24) = W_SyntaxError([W_UnicodeObject('future feature bogus is not defined'), W_Tuple....W_NoneObject object at 0x0000000007253bb0>, W_IntObject(1), W_IntObject(29))]).w_offset
interpreter/test/test_compiler.py:347: AssertionError
builder: own-linux-x86-64 build #10976+
test: pypy/interpreter/test/test_compiler.py::TestPythonAstCompiler::()::test_future_error_offset