diff --git a/xarray/tests/__init__.py b/xarray/tests/__init__.py index 07ba0be6a8c..0a70334bc01 100644 --- a/xarray/tests/__init__.py +++ b/xarray/tests/__init__.py @@ -95,6 +95,10 @@ def _importorskip( requires_pandas_version_two = pytest.mark.skipif( not has_pandas_version_two, reason="requires pandas 2.0.0" ) +has_h5netcdf_ros3 = _importorskip("h5netcdf", "1.3.0") +requires_h5netcdf_ros3 = pytest.mark.skipif( + not has_h5netcdf_ros3[0], reason="requires h5netcdf 1.3.0" +) # change some global options for tests set_options(warn_for_unclosed_files=True) diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index b8de49c0365..b9fa499a03d 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -77,6 +77,7 @@ requires_scipy, requires_scipy_or_netCDF4, requires_zarr, + requires_h5netcdf_ros3, ) from xarray.tests.test_coding_times import ( _ALL_CALENDARS, @@ -3444,7 +3445,7 @@ def test_write_inconsistent_chunks(self) -> None: assert actual["y"].encoding["chunksizes"] == (100, 50) -@requires_h5netcdf +@requires_h5netcdf_ros3 class TestH5NetCDFDataRos3Driver(TestCommon): engine: T_NetcdfEngine = "h5netcdf" test_remote_dataset: str = (