pypy/interpreter/test/test_zpy.py::test_pytrace_dis_bug
def test_pytrace_dis_bug():
output = run(sys.executable, pypypath, '-S',
stdin="__pytrace__ = 1\nfor i in range(1): i += 1\n")
output = output.replace('\r\n', '\n')
assert """\
\t<module>: LOAD_NAME 0 (range)
\t<module>: LOAD_CONST 0 (1)
\t<module>: CALL_FUNCTION 1
\t<module>: GET_ITER 0
\t<module>: FOR_ITER 6 (to 20)
\t<module>: STORE_NAME 1 (i)
\t<module>: LOAD_NAME 1 (i)
\t<module>: LOAD_CONST 0 (1)
\t<module>: INPLACE_ADD 0
\t<module>: STORE_NAME 1 (i)
\t<module>: JUMP_ABSOLUTE 4 (to 8)
\t<module>: FOR_ITER 6 (to 20)
\t<module>: RETURN_CONST 1 (None)
> """ in output
E assert '\t<module>: LOAD_NAME 0 (range)\n\t<module>: LOAD_CONST 0 (1)\n\t<module>: CALL_F...MP_ABSOLUTE 4 (to 8)\n\t<module>: FOR_ITER 6 (to 20)\n\t<module>: RETURN_CONST 1 (None)\n' in '>>>> Tracing enabled\n>>>> \t<module>: LOAD_NAME 0 (range)\n\t<module>: LOAD_CONST 0 (1)\n\...SOLUTE 4 (to 8)\n\t<module>: FOR_ITER 6 (to 20)\n\t<module>: RETURN_CONST 1 (None)\n>>>> '
interpreter/test/test_zpy.py:169: AssertionError
---------- Captured stdout call ----------
--- stdout ---
>>>> Tracing enabled
>>>> <module>: LOAD_NAME 0 (range)
<module>: LOAD_CONST 0 (1)
<module>: CALL_FUNCTION 1
<module>: GET_ITER 0
remove: LOAD_DEREF 0 (self_weakref)
remove: CALL_FUNCTION 0
remove: STORE_FAST 1 (self)
remove: LOAD_FAST 1 (self)
remove: LOAD_CONST 0 (None)
remove: IS_OP 1
remove: POP_JUMP_IF_FALSE 27 (to 54)
remove: LOAD_FAST 1 (self)
remove: LOAD_ATTR 0 (_iterating)
remove: POP_JUMP_IF_FALSE 18 (to 36)
remove: LOAD_GLOBAL 4 (_weakref)
remove: LOAD_METHOD 5 (_remove_dead_weakref)
remove: LOAD_FAST 1 (self)
remove: LOAD_ATTR 6 (data)
remove: LOAD_FAST 0 (wr)
remove: LOAD_ATTR 3 (key)
remove: CALL_METHOD 2
remove: POP_TOP 0
remove: RETURN_CONST 0 (None)
<module>: FOR_ITER 6 (to 20)
<module>: STORE_NAME 1 (i)
<module>: LOAD_NAME 1 (i)
<module>: LOAD_CONST 0 (1)
<module>: INPLACE_ADD 0
<module>: STORE_NAME 1 (i)
<module>: JUMP_ABSOLUTE 4 (to 8)
<module>: FOR_ITER 6 (to 20)
<module>: RETURN_CONST 1 (None)
>>>>
()
--- stderr ---
None
()
---------- Captured stderr call ----------
PyPy 8.0.0-alpha0 in StdObjSpace on top of Python 2.7.18 (startuptime: 13.55 secs)
builder: own-linux-aarch64 build #2850+
test: pypy/interpreter/test/test_zpy.py::test_pytrace_dis_bug