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

Function test_nativefile_write_memoryview

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

BufferOutputStreamMethod · 0.80
writeMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected