ctypes_tests.test_functions:test_keepalive_buffers
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x00000001288a8410>
dll = <[TypeError("unsupported operand type(s) for &: '_rawffi.alt.CDLL' and 'int'") raised in repr()] CDLL object at 0x1288b97f8>
@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 b'' == b'bcd'
E Use -v to get the full diff
../build/extra_tests/ctypes_tests/test_functions.py:85: AssertionError
builder: pypy-c-jit-macos-arm64 build #1298+
test: ctypes_tests.test_functions:test_keepalive_buffers