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

Function add_fs

python/pyarrow/conftest.py:295–313  ·  view source on GitHub ↗
(doctest_namespace, request, tmp_path)

Source from the content-addressed store, hash-verified

293# Define doctest_namespace for fs module docstring import
294@pytest.fixture(autouse=True)
295def add_fs(doctest_namespace, request, tmp_path):
296
297 # Trigger ONLY for the doctests
298 doctest_m = request.config.option.doctestmodules
299 doctest_c = getattr(request.config.option, "doctest_cython", False)
300
301 if doctest_m or doctest_c:
302 # fs import
303 doctest_namespace["fs"] = fs
304
305 # Creation of an object and file with data
306 local = fs.LocalFileSystem()
307 path = tmp_path / 'pyarrow-fs-example.dat'
308 with local.open_output_stream(str(path)) as stream:
309 stream.write(b'data')
310 doctest_namespace["local"] = local
311 doctest_namespace["local_path"] = str(tmp_path)
312 doctest_namespace["path"] = str(path)
313 yield
314
315
316# Define udf fixture for test_udf.py and test_substrait.py

Callers

nothing calls this directly

Calls 3

LocalFileSystemMethod · 0.80
open_output_streamMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected