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

Function test_bytes_reader_retains_parent_reference

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

Source from the content-addressed store, hash-verified

304
305
306def test_bytes_reader_retains_parent_reference():
307 import gc
308
309 # ARROW-421
310 def get_buffer():
311 data = b'some sample data' * 1000
312 reader = pa.BufferReader(data)
313 reader.seek(5)
314 return reader.read_buffer(6)
315
316 buf = get_buffer()
317 gc.collect()
318 assert buf.to_pybytes() == b'sample'
319 assert buf.parent is not None
320
321
322def test_python_file_implicit_mode(tmpdir):

Callers

nothing calls this directly

Calls 1

get_bufferFunction · 0.85

Tested by

no test coverage detected