(request, gcs_server)
| 210 | |
| 211 | @pytest.fixture |
| 212 | def gcsfs(request, gcs_server): |
| 213 | request.config.pyarrow.requires('gcs') |
| 214 | from pyarrow.fs import GcsFileSystem |
| 215 | |
| 216 | host, port = gcs_server['connection'] |
| 217 | bucket = 'pyarrow-filesystem/' |
| 218 | |
| 219 | fs = GcsFileSystem( |
| 220 | endpoint_override=f'{host}:{port}', |
| 221 | scheme='http', |
| 222 | # Mock endpoint doesn't check credentials. |
| 223 | anonymous=True, |
| 224 | retry_time_limit=timedelta(seconds=45), |
| 225 | project_id='test-project-id' |
| 226 | ) |
| 227 | try: |
| 228 | fs.create_dir(bucket) |
| 229 | except OSError as e: |
| 230 | pytest.skip(f"Could not create directory in {fs}: {e}") |
| 231 | |
| 232 | yield dict( |
| 233 | fs=fs, |
| 234 | pathfn=bucket.__add__, |
| 235 | allow_move_dir=False, |
| 236 | allow_append_to_file=False, |
| 237 | ) |
| 238 | fs.delete_dir(bucket) |
| 239 | |
| 240 | |
| 241 | @pytest.fixture |
nothing calls this directly
no test coverage detected