ctypes_tests.test_functions:test_keepalive_buffers
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x000000011142ff30>
dll = <CDLL '/private/tmp/buildbot-arm64/pytest-of-matti/pytest-24/_ctypes_test0/_ctypes_test.so', handle 8cb1f5b0 at 11142f050>
@pytest.mark.pypy_only
def test_keepalive_buffers(monkeypatch, dll):
import gc
f = dll.my_strchr
f.argtypes = [c_char_p]
f.restype = c_char_p
#
orig__call_funcptr = f._call_funcptr
def _call_funcptr(funcptr, *newargs):
gc.collect()
gc.collect()
gc.collect()
return orig__call_funcptr(funcptr, *newargs)
monkeypatch.setattr(f, '_call_funcptr', _call_funcptr)
#
result = f(b"abcd", ord("b"))
> assert result == b"bcd"
E AssertionError: assert '' == 'bcd'
E + bcd
../build/extra_tests/ctypes_tests/test_functions.py:85: AssertionError
builder: pypy-c-jit-macos-arm64 build #1437+
test: ctypes_tests.test_functions:test_keepalive_buffers