Home - Summaries: (main) : (py3.11) : (py3.12) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

pypy/interpreter/test/test_compiler.py::TestPythonAstCompiler::()::test_future_error_offset

self = <pypy.interpreter.test.test_compiler.TestPythonAstCompiler instance at 0xf1e5144c>

    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...neobject.W_NoneObject object at 0xf548a1ac>, W_IntObject(1), W_IntObject(29))]).w_offset

interpreter/test/test_compiler.py:347: AssertionError
builder: own-linux-x86-32 build #9507+
test: pypy/interpreter/test/test_compiler.py::TestPythonAstCompiler::()::test_future_error_offset