pypy/module/sys/test/apptest_monitoring.py::test_fire_py_start_return
def test_fire_py_start_return():
E = sys.monitoring.events
events = []
def callback(*args):
events.append(args)
sys.monitoring.use_tool_id(3, "test tool")
try:
sys.monitoring.register_callback(3, E.PY_START, callback)
sys.monitoring.register_callback(3, E.PY_RETURN, callback)
sys.monitoring.set_events(3, E.PY_START | E.PY_RETURN)
def f():
return 42
events.clear()
assert f() == 42
> assert len(events) == 2
E (application-level) AssertionError: assert 1 == 2
E + where 1 = len([(<code object f at 0x000000000c85c678, file "/buildbot/slave/own-linux-x86-64/build/pypy/module/sys/test/apptest_monitoring.py", line 311>, 0)])
module/sys/test/apptest_monitoring.py:316: AssertionError
builder: own-linux-x86-64 build #10997+
test: pypy/module/sys/test/apptest_monitoring.py::test_fire_py_start_return