()
| 1590 | |
| 1591 | @pytest.mark.numpy |
| 1592 | def test_buffered_output_stream_detach(): |
| 1593 | np_buf = np.zeros(100, dtype=np.int8) # zero-initialized buffer |
| 1594 | buf = pa.py_buffer(np_buf) |
| 1595 | |
| 1596 | f = pa.BufferedOutputStream(pa.FixedSizeBufferWriter(buf), buffer_size=4) |
| 1597 | f.write(b"12") |
| 1598 | assert np_buf[:4].tobytes() == b'\0\0\0\0' |
| 1599 | raw = f.detach() |
| 1600 | assert f.closed |
| 1601 | assert not raw.closed |
| 1602 | assert np_buf[:4].tobytes() == b'12\0\0' |
| 1603 | |
| 1604 | |
| 1605 | # ---------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected