(reader_factory)
| 488 | [make_ipc_stream_reader, |
| 489 | make_py_record_batch_reader]) |
| 490 | def test_export_import_batch_reader(reader_factory): |
| 491 | c_stream = ffi.new("struct ArrowArrayStream*") |
| 492 | ptr_stream = int(ffi.cast("uintptr_t", c_stream)) |
| 493 | |
| 494 | gc.collect() # Make sure no Arrow data dangles in a ref cycle |
| 495 | old_allocated = pa.total_allocated_bytes() |
| 496 | |
| 497 | _export_import_batch_reader(ptr_stream, reader_factory) |
| 498 | |
| 499 | assert pa.total_allocated_bytes() == old_allocated |
| 500 | |
| 501 | # Now released |
| 502 | with assert_stream_released: |
| 503 | pa.RecordBatchReader._import_from_c(ptr_stream) |
| 504 | |
| 505 | |
| 506 | @needs_cffi |
nothing calls this directly
no test coverage detected