Skip to content

Commit 8754f85

Browse files
d-v-bclaude
andcommitted
test: skip fsspec-backed get_ranges tests on old fsspec
The min_deps CI job pins fsspec to 2023.10.0, which predates AsyncFileSystemWrapper. Wrapping a sync MemoryFileSystem fails there at fixture setup. Guard the affected tests with the same skipif pattern already used in test_fsspec.py. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 79e9927 commit 8754f85

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

tests/test_store/test_fsspec_get_ranges.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from __future__ import annotations
99

1010
import pytest
11+
from packaging.version import parse as parse_version
1112

1213
from zarr.abc.store import RangeByteRequest
1314
from zarr.core._coalesce import DEFAULT_COALESCE_OPTIONS, CoalesceOptions
@@ -17,6 +18,13 @@
1718

1819
fsspec = pytest.importorskip("fsspec")
1920

21+
# AsyncFileSystemWrapper (needed to wrap a sync MemoryFileSystem) landed in fsspec 2024.12.0.
22+
# Older versions are pinned by the min-deps CI job, so skip the whole file there.
23+
pytestmark = pytest.mark.skipif(
24+
parse_version(fsspec.__version__) < parse_version("2024.12.0"),
25+
reason="No AsyncFileSystemWrapper",
26+
)
27+
2028

2129
@pytest.fixture
2230
def memory_store() -> FsspecStore:

tests/test_store/test_protocols.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,20 @@
77

88
from zarr.storage._protocols import SupportsGetRanges
99

10+
fsspec = pytest.importorskip("fsspec")
1011

12+
from packaging.version import parse as parse_version # noqa: E402
13+
14+
# AsyncFileSystemWrapper (needed to wrap a sync MemoryFileSystem) landed in fsspec 2024.12.0.
15+
# Older versions are pinned by the min-deps CI job.
16+
_needs_async_wrapper = pytest.mark.skipif(
17+
parse_version(fsspec.__version__) < parse_version("2024.12.0"),
18+
reason="No AsyncFileSystemWrapper",
19+
)
20+
21+
22+
@_needs_async_wrapper
1123
def test_fsspec_store_satisfies_supports_get_ranges() -> None:
12-
pytest.importorskip("fsspec")
1324
from fsspec.implementations.memory import MemoryFileSystem
1425

1526
from zarr.storage import FsspecStore
@@ -34,5 +45,4 @@ def test_type_assignment_at_module_level() -> None:
3445
3546
If this runs without error the module imported cleanly; the static check is in mypy.
3647
"""
37-
pytest.importorskip("fsspec")
3848
from zarr.storage import _fsspec # noqa: F401

0 commit comments

Comments
 (0)