Skip to content

Commit b5e4ad7

Browse files
committed
decorate the zarr tests using dask or obj.chunk with requires_dask
1 parent 280a14f commit b5e4ad7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

xarray/tests/test_backends.py

+9
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,7 @@ def test_roundtrip_consolidated(self):
15391539
self.check_dtypes_roundtripped(expected, actual)
15401540
assert_identical(expected, actual)
15411541

1542+
@requires_dask
15421543
def test_auto_chunk(self):
15431544
original = create_test_data().chunk()
15441545

@@ -1556,6 +1557,7 @@ def test_auto_chunk(self):
15561557
# chunk size should be the same as original
15571558
assert v.chunks == original[k].chunks
15581559

1560+
@requires_dask
15591561
@pytest.mark.filterwarnings("ignore:Specified Dask chunks")
15601562
def test_manual_chunk(self):
15611563
original = create_test_data().chunk({"dim1": 3, "dim2": 4, "dim3": 3})
@@ -1598,6 +1600,7 @@ def test_manual_chunk(self):
15981600
assert_identical(actual, auto)
15991601
assert_identical(actual.load(), auto.load())
16001602

1603+
@requires_dask
16011604
def test_warning_on_bad_chunks(self):
16021605
original = create_test_data().chunk({"dim1": 4, "dim2": 3, "dim3": 5})
16031606

@@ -1620,6 +1623,7 @@ def test_warning_on_bad_chunks(self):
16201623
assert v._in_memory == (k in actual.dims)
16211624
assert len(record) == 0
16221625

1626+
@requires_dask
16231627
def test_deprecate_auto_chunk(self):
16241628
original = create_test_data().chunk()
16251629
with pytest.warns(FutureWarning):
@@ -1638,6 +1642,7 @@ def test_deprecate_auto_chunk(self):
16381642
# there should be no chunks
16391643
assert v.chunks is None
16401644

1645+
@requires_dask
16411646
def test_write_uneven_dask_chunks(self):
16421647
# regression for GH#2225
16431648
original = create_test_data().chunk({"dim1": 3, "dim2": 4, "dim3": 3})
@@ -1662,6 +1667,7 @@ def test_chunk_encoding(self):
16621667
with self.roundtrip(data) as actual:
16631668
pass
16641669

1670+
@requires_dask
16651671
def test_chunk_encoding_with_dask(self):
16661672
# These datasets DO have dask chunks. Need to check for various
16671673
# interactions between dask and zarr chunks
@@ -1896,6 +1902,7 @@ def test_append_with_new_variable(self):
18961902
combined["new_var"] = ds_with_new_var["new_var"]
18971903
assert_identical(combined, xr.open_zarr(store_target))
18981904

1905+
@requires_dask
18991906
def test_to_zarr_compute_false_roundtrip(self):
19001907
from dask.delayed import Delayed
19011908

@@ -1915,6 +1922,7 @@ def test_to_zarr_compute_false_roundtrip(self):
19151922
with self.open(store) as actual:
19161923
assert_identical(original, actual)
19171924

1925+
@requires_dask
19181926
def test_to_zarr_append_compute_false_roundtrip(self):
19191927
from dask.delayed import Delayed
19201928

@@ -1951,6 +1959,7 @@ def test_to_zarr_append_compute_false_roundtrip(self):
19511959
with self.open(store) as actual:
19521960
assert_identical(xr.concat([ds, ds_to_append], dim="time"), actual)
19531961

1962+
@requires_dask
19541963
def test_encoding_chunksizes(self):
19551964
# regression test for GH2278
19561965
# see also test_encoding_chunksizes_unlimited

0 commit comments

Comments
 (0)