()
| 1008 | |
| 1009 | @pytest.mark.numpy |
| 1010 | def test_nativefile_write_memoryview(): |
| 1011 | f = pa.BufferOutputStream() |
| 1012 | data = b'ok' |
| 1013 | |
| 1014 | arr = np.frombuffer(data, dtype='S1') |
| 1015 | |
| 1016 | f.write(arr) |
| 1017 | f.write(bytearray(data)) |
| 1018 | f.write(pa.py_buffer(data)) |
| 1019 | with pytest.raises(TypeError): |
| 1020 | f.write(data.decode('utf8')) |
| 1021 | |
| 1022 | buf = f.getvalue() |
| 1023 | |
| 1024 | assert buf.to_pybytes() == data * 3 |
| 1025 | |
| 1026 | |
| 1027 | @pytest.mark.parametrize("dst_buf", [b"a", memoryview(b"a")]) |
nothing calls this directly
no test coverage detected