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

Function sample_disk_data

python/pyarrow/tests/test_io.py:1074–1088  ·  view source on GitHub ↗
(request, tmpdir)

Source from the content-addressed store, hash-verified

1072
1073@pytest.fixture
1074def sample_disk_data(request, tmpdir):
1075 SIZE = 4096
1076 arr = [random.randint(0, 255) for _ in range(SIZE)]
1077 data = bytes(arr[:SIZE])
1078
1079 path = os.path.join(str(tmpdir), guid())
1080
1081 with open(path, 'wb') as f:
1082 f.write(data)
1083
1084 def teardown():
1085 _try_delete(path)
1086
1087 request.addfinalizer(teardown)
1088 return path, data
1089
1090
1091def _check_native_file_reader(FACTORY, sample_data,

Callers

nothing calls this directly

Calls 4

guidFunction · 0.90
bytesFunction · 0.85
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected