(reader_factory)
| 455 | [make_ipc_stream_reader, |
| 456 | make_py_record_batch_reader]) |
| 457 | def test_export_import_batch_reader(reader_factory): |
| 458 | c_stream = ffi.new("struct ArrowArrayStream*") |
| 459 | ptr_stream = int(ffi.cast("uintptr_t", c_stream)) |
| 460 | |
| 461 | gc.collect() # Make sure no Arrow data dangles in a ref cycle |
| 462 | old_allocated = pa.total_allocated_bytes() |
| 463 | |
| 464 | _export_import_batch_reader(ptr_stream, reader_factory) |
| 465 | |
| 466 | assert pa.total_allocated_bytes() == old_allocated |
| 467 | |
| 468 | # Now released |
| 469 | with assert_stream_released: |
| 470 | pa.RecordBatchReader._import_from_c(ptr_stream) |
| 471 | |
| 472 | |
| 473 | @needs_cffi |
nothing calls this directly
no test coverage detected