From a874739378f28f68c4e184c5bf1cebdb749dc836 Mon Sep 17 00:00:00 2001 From: Joeperdefloep Date: Fri, 2 Jul 2021 13:40:04 +0200 Subject: [PATCH 1/2] added netCDF4 requirement to failing tests --- xarray/tests/test_backends.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index 5079cd390f1..903d9a7cae7 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -2777,6 +2777,7 @@ def test_dump_encodings_h5py(self): @requires_h5netcdf +@requires_netCDF4 class TestH5NetCDFAlreadyOpen: def test_open_dataset_group(self): import h5netcdf @@ -5162,11 +5163,12 @@ def test_open_fsspec(): @requires_h5netcdf +@requires_netCDF4 def test_load_single_value_h5netcdf(tmp_path): """Test that numeric single-element vector attributes are handled fine. At present (h5netcdf v0.8.1), the h5netcdf exposes single-valued numeric variable - attributes as arrays of length 1, as oppesed to scalars for the NetCDF4 + attributes as arrays of length 1, as opposed to scalars for the NetCDF4 backend. This was leading to a ValueError upon loading a single value from a file, see #4471. Test that loading causes no failure. """ From fab8263d43bdf3dc533eee23c9f29b3c376cd720 Mon Sep 17 00:00:00 2001 From: Joeperdefloep Date: Fri, 2 Jul 2021 22:57:13 +0200 Subject: [PATCH 2/2] added require_scipy #5564 --- xarray/tests/test_backends.py | 1 + xarray/tests/test_interp.py | 1 + 2 files changed, 2 insertions(+) diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index 903d9a7cae7..cd372165948 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -2862,6 +2862,7 @@ def test_open_twice(self): with open_dataset(f, engine="h5netcdf"): pass + @requires_scipy def test_open_fileobj(self): # open in-memory datasets instead of local file paths expected = create_test_data().drop_vars("dim3") diff --git a/xarray/tests/test_interp.py b/xarray/tests/test_interp.py index 4f6dc616504..2029e6af05b 100644 --- a/xarray/tests/test_interp.py +++ b/xarray/tests/test_interp.py @@ -727,6 +727,7 @@ def test_datetime_interp_noerror(): @requires_cftime +@requires_scipy def test_3641(): times = xr.cftime_range("0001", periods=3, freq="500Y") da = xr.DataArray(range(3), dims=["time"], coords=[times])