|
6 | 6 |
|
7 | 7 | import pytest |
8 | 8 | from botocore.session import Session |
9 | | -from fsspec.implementations.asyn_wrapper import AsyncFileSystemWrapper |
| 9 | +from packaging.version import parse as parse_version |
10 | 10 |
|
11 | 11 | import zarr.api.asynchronous |
12 | 12 | from zarr.abc.store import OffsetByteRequest |
@@ -218,16 +218,28 @@ async def test_empty_nonexistent_path(self, store_kwargs) -> None: |
218 | 218 | assert await store.is_empty("") |
219 | 219 |
|
220 | 220 |
|
| 221 | +@pytest.mark.skipif( |
| 222 | + parse_version(fsspec.__version__) < parse_version("2024.12.0"), |
| 223 | + reason="No AsyncFileSystemWrapper", |
| 224 | +) |
221 | 225 | def test_wrap_sync_filesystem(): |
222 | 226 | """The local fs is not async so we should expect it to be wrapped automatically""" |
| 227 | + from fsspec.implementations.asyn_wrapper import AsyncFileSystemWrapper |
| 228 | + |
223 | 229 | store = FsspecStore.from_url("local://test/path") |
224 | 230 |
|
225 | 231 | assert isinstance(store.fs, AsyncFileSystemWrapper) |
226 | 232 | assert store.fs.async_impl |
227 | 233 |
|
228 | 234 |
|
| 235 | +@pytest.mark.skipif( |
| 236 | + parse_version(fsspec.__version__) < parse_version("2024.12.0"), |
| 237 | + reason="No AsyncFileSystemWrapper", |
| 238 | +) |
229 | 239 | def test_no_wrap_async_filesystem(): |
230 | 240 | """An async fs should not be wrapped automatically; fsspec's https filesystem is such an fs""" |
| 241 | + from fsspec.implementations.asyn_wrapper import AsyncFileSystemWrapper |
| 242 | + |
231 | 243 | store = FsspecStore.from_url("https://test/path") |
232 | 244 |
|
233 | 245 | assert not isinstance(store.fs, AsyncFileSystemWrapper) |
|
0 commit comments