From 888e7809c948c8d35ddf60b234f89965b318cfe9 Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Sat, 2 Nov 2024 22:56:05 -0600 Subject: [PATCH] fix tests --- xarray/tests/__init__.py | 4 +++- xarray/tests/test_dask.py | 2 ++ xarray/tests/test_groupby.py | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/xarray/tests/__init__.py b/xarray/tests/__init__.py index 7b8795cc09e..3999aec9cbb 100644 --- a/xarray/tests/__init__.py +++ b/xarray/tests/__init__.py @@ -107,7 +107,9 @@ def _importorskip( has_h5netcdf, requires_h5netcdf = _importorskip("h5netcdf") has_cftime, requires_cftime = _importorskip("cftime") has_dask, requires_dask = _importorskip("dask") -has_dask_ge_2024_08_1, _ = _importorskip("dask", minversion="2024.08.1") +has_dask_ge_2024_08_1, requires_dask_ge_2024_08_1 = _importorskip( + "dask", minversion="2024.08.1" +) with warnings.catch_warnings(): warnings.filterwarnings( "ignore", diff --git a/xarray/tests/test_dask.py b/xarray/tests/test_dask.py index c87dd61a6e5..dc00c9c95c6 100644 --- a/xarray/tests/test_dask.py +++ b/xarray/tests/test_dask.py @@ -24,6 +24,7 @@ assert_identical, mock, raise_if_dask_computes, + requires_dask_ge_2024_08_1, requires_pint, requires_scipy_or_netCDF4, ) @@ -1813,6 +1814,7 @@ def test_minimize_graph_size(): assert actual == numchunks[var], (actual, numchunks[var]) +@requires_dask_ge_2024_08_1 @pytest.mark.parametrize( "chunks, expected_chunks", [ diff --git a/xarray/tests/test_groupby.py b/xarray/tests/test_groupby.py index ad5b5d41ff7..62bf5faa115 100644 --- a/xarray/tests/test_groupby.py +++ b/xarray/tests/test_groupby.py @@ -37,6 +37,7 @@ raise_if_dask_computes, requires_cftime, requires_dask, + requires_dask_ge_2024_08_1, requires_flox, requires_flox_0_9_12, requires_pandas_ge_2_2, @@ -3048,7 +3049,7 @@ def test_groupby_multiple_bin_grouper_missing_groups(): assert_identical(actual, expected) -@requires_dask +@requires_dask_ge_2024_08_1 def test_shuffle_by_simple() -> None: da = xr.DataArray( dims="x",