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

Function check_buffer_pickling

python/pyarrow/tests/test_io.py:384–391  ·  view source on GitHub ↗
(buf, pickler)

Source from the content-addressed store, hash-verified

382
383
384def check_buffer_pickling(buf, pickler):
385 # Check that buffer survives a pickle roundtrip
386 for protocol in range(0, pickler.HIGHEST_PROTOCOL + 1):
387 result = pickler.loads(pickler.dumps(buf, protocol=protocol))
388 assert len(result) == len(buf)
389 assert memoryview(result) == memoryview(buf)
390 assert result.to_pybytes() == buf.to_pybytes()
391 assert result.is_mutable == buf.is_mutable
392
393
394def test_buffer_bytes(pickle_module):

Callers 4

test_buffer_bytesFunction · 0.85
test_buffer_null_dataFunction · 0.85
test_buffer_memoryviewFunction · 0.85
test_buffer_bytearrayFunction · 0.85

Calls 3

lenFunction · 0.85
loadsMethod · 0.80
dumpsMethod · 0.80

Tested by

no test coverage detected