(doctest_namespace, request, tmp_path)
| 293 | # Define doctest_namespace for fs module docstring import |
| 294 | @pytest.fixture(autouse=True) |
| 295 | def 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 |
nothing calls this directly
no test coverage detected