Skip to content

Commit 4b22e98

Browse files
authored
refactor: remove dead zarr<3 (has_zarr_v3) guards in tests (#11376)
* refactor: remove dead zarr<3 (has_zarr_v3) guards in tests * fix: keep has_zarr short-circuit in zarr-format helpers for zarr-less envs --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
1 parent 057f703 commit 4b22e98

3 files changed

Lines changed: 90 additions & 238 deletions

File tree

xarray/tests/__init__.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ def _importorskip(
131131
has_bottleneck, requires_bottleneck = _importorskip("bottleneck")
132132
has_rasterio, requires_rasterio = _importorskip("rasterio")
133133
has_zarr, requires_zarr = _importorskip("zarr")
134-
has_zarr_v3, requires_zarr_v3 = _importorskip("zarr", "3.0.0")
134+
requires_zarr_v3 = requires_zarr
135135
has_zarr_v3_dtypes, requires_zarr_v3_dtypes = _importorskip("zarr", "3.1.0")
136136
has_zarr_v3_async_oindex, requires_zarr_v3_async_oindex = _importorskip("zarr", "3.1.2")
137-
if has_zarr_v3:
137+
if has_zarr:
138138
import zarr
139139

140140
# manual update by checking attrs for now
@@ -197,14 +197,7 @@ def _importorskip(
197197
"zarr_format",
198198
[
199199
pytest.param(2, id="zarr_format=2"),
200-
pytest.param(
201-
3,
202-
marks=pytest.mark.skipif(
203-
not has_zarr_v3,
204-
reason="zarr-python v2 cannot understand the zarr v3 format",
205-
),
206-
id="zarr_format=3",
207-
),
200+
pytest.param(3, id="zarr_format=3"),
208201
],
209202
)
210203

0 commit comments

Comments
 (0)