MCPcopy Create free account
hub / github.com/apache/arrow / test_buffer_address

Function test_buffer_address

python/pyarrow/tests/test_io.py:504–521  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

502
503@pytest.mark.numpy
504def test_buffer_address():
505 b1 = b'some data!'
506 b2 = bytearray(b1)
507 b3 = bytearray(b1)
508
509 buf1 = pa.py_buffer(b1)
510 buf2 = pa.py_buffer(b1)
511 buf3 = pa.py_buffer(b2)
512 buf4 = pa.py_buffer(b3)
513
514 assert buf1.address > 0
515 assert buf1.address == buf2.address
516 assert buf3.address != buf2.address
517 assert buf4.address != buf3.address
518
519 arr = np.arange(5)
520 buf = pa.py_buffer(arr)
521 assert buf.address == arr.ctypes.data
522
523
524@pytest.mark.numpy

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected