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