Skip to content

Commit b74d4ed

Browse files
committed
Skip zarr3 files if zarr<3 in env.
1 parent 60e4edb commit b74d4ed

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/integration/test_zarr_to_iris.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
import iris
88
import pytest
99
import xarray as xr
10+
import zarr
1011

1112
from ncdata.iris_xarray import cubes_from_xarray as conversion_func
1213

14+
zarr_major_version = int(zarr.__version__.split(".")[0])
15+
1316

1417
def _return_kwargs():
1518
time_coder = xr.coders.CFDatetimeCoder(use_cftime=True)
@@ -52,6 +55,9 @@ def test_load_zarr2_local():
5255
_run_checks(cube)
5356

5457

58+
@pytest.mark.skipif(
59+
zarr_major_version < 3, reason="Zarr3 file not supported by zarr v2."
60+
)
5561
def test_load_zarr3_local():
5662
"""Test loading a Zarr3 store from local FS."""
5763
zarr_path = (
@@ -97,6 +103,9 @@ def _is_url_ok(url):
97103
)
98104

99105

106+
@pytest.mark.skipif(
107+
zarr_major_version < 3, reason="Zarr3 file not supported by zarr v2."
108+
)
100109
@pytest.mark.skipif(not _S3_accessible, reason="S3 url not accessible")
101110
def test_load_remote_zarr():
102111
"""Test loading a remote Zarr store.

0 commit comments

Comments
 (0)