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

Function test_nativefile_write_memoryview

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

Source from the content-addressed store, hash-verified

1011
1012@pytest.mark.numpy
1013def test_nativefile_write_memoryview():
1014 f = pa.BufferOutputStream()
1015 data = b'ok'
1016
1017 arr = np.frombuffer(data, dtype='S1')
1018
1019 f.write(arr)
1020 f.write(bytearray(data))
1021 f.write(pa.py_buffer(data))
1022 with pytest.raises(TypeError):
1023 f.write(data.decode('utf8'))
1024
1025 buf = f.getvalue()
1026
1027 assert buf.to_pybytes() == data * 3
1028
1029
1030# ----------------------------------------------------------------------

Callers

nothing calls this directly

Calls 3

BufferOutputStreamMethod · 0.80
writeMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected