Skip to content

Commit 101b280

Browse files
committed
change test to not expect warning if consolidated metadata not supported
1 parent 1e30664 commit 101b280

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

xarray/tests/test_backends.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2405,12 +2405,13 @@ def test_read_non_consolidated_warning(self) -> None:
24052405
self.save(
24062406
expected, store_target=store, consolidated=False, **self.version_kwargs
24072407
)
2408-
with pytest.warns(
2409-
RuntimeWarning,
2410-
match="Failed to open Zarr store with consolidated",
2411-
):
2412-
with xr.open_zarr(store, **self.version_kwargs) as ds:
2413-
assert_identical(ds, expected)
2408+
if getattr(store, "supports_consolidated_metadata", True):
2409+
with pytest.warns(
2410+
RuntimeWarning,
2411+
match="Failed to open Zarr store with consolidated",
2412+
):
2413+
with xr.open_zarr(store, **self.version_kwargs) as ds:
2414+
assert_identical(ds, expected)
24142415

24152416
def test_non_existent_store(self) -> None:
24162417
with pytest.raises(

0 commit comments

Comments
 (0)