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

Function test_buffer_protocol_respects_immutability

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

Source from the content-addressed store, hash-verified

635
636@pytest.mark.numpy
637def test_buffer_protocol_respects_immutability():
638 # ARROW-3228; NumPy's frombuffer ctor determines whether a buffer-like
639 # object is mutable by first attempting to get a mutable buffer using
640 # PyObject_FromBuffer. If that fails, it assumes that the object is
641 # immutable
642 a = b'12345'
643 arrow_ref = pa.py_buffer(a)
644 numpy_ref = np.frombuffer(arrow_ref, dtype=np.uint8)
645 assert not numpy_ref.flags.writeable
646
647
648@pytest.mark.numpy

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected