Skip to content

Commit 6e8aec7

Browse files
committed
fix fsspec test
1 parent afbfc6a commit 6e8aec7

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

pandas/tests/io/conftest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,13 @@ def remote_csv_directory(monkeypatch):
252252

253253
monkeypatch.setattr("fsspec.filesystem", lambda _: fs)
254254
return f"s3://{dir_name}"
255+
256+
257+
@pytest.fixture
258+
def empty_local_file(tmp_path):
259+
"""
260+
Fixture to create an empty local file.
261+
"""
262+
file_path = tmp_path / "empty_file.csv"
263+
file_path.touch()
264+
return file_path

pandas/tests/io/test_fsspec.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,13 @@ def test_markdown_options(fsspectest):
342342
assert fsspectest.cat("testmem://mockfile")
343343

344344

345-
def test_non_fsspec_options():
345+
def test_non_fsspec_options(empty_local_file):
346346
pytest.importorskip("pyarrow")
347347
with pytest.raises(ValueError, match="storage_options"):
348-
read_csv("localfile", storage_options={"a": True})
348+
read_csv(empty_local_file, storage_options={"a": True})
349349
with pytest.raises(ValueError, match="storage_options"):
350350
# separate test for parquet, which has a different code path
351-
read_parquet("localfile", storage_options={"a": True})
351+
read_parquet(empty_local_file, storage_options={"a": True})
352352
by = io.BytesIO()
353353

354354
with pytest.raises(ValueError, match="storage_options"):

0 commit comments

Comments
 (0)