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

Function add_fs

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

Source from the content-addressed store, hash-verified

285# Define doctest_namespace for fs module docstring import
286@pytest.fixture(autouse=True)
287def add_fs(doctest_namespace, request, tmp_path):
288
289 # Trigger ONLY for the doctests
290 doctest_m = request.config.option.doctestmodules
291 doctest_c = getattr(request.config.option, "doctest_cython", False)
292
293 if doctest_m or doctest_c:
294 # fs import
295 doctest_namespace["fs"] = fs
296
297 # Creation of an object and file with data
298 local = fs.LocalFileSystem()
299 path = tmp_path / 'pyarrow-fs-example.dat'
300 with local.open_output_stream(str(path)) as stream:
301 stream.write(b'data')
302 doctest_namespace["local"] = local
303 doctest_namespace["local_path"] = str(tmp_path)
304 doctest_namespace["path"] = str(path)
305 yield
306
307
308# 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