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

Function add_fs

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

Source from the content-addressed store, hash-verified

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