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