Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Dec 17, 2024
1 parent e8cd3c8 commit 8d31f0e
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions xarray/tests/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -2579,7 +2579,7 @@ def test_hidden_zarr_keys(self) -> None:
skip_if_zarr_format_3("This test is unnecessary; no hidden Zarr keys")

expected = create_test_data()
with self.create_store(cache_members=False) as store:
with self.create_store() as store:
expected.dump_to_store(store)
zarr_group = store.ds

Expand Down Expand Up @@ -3566,27 +3566,6 @@ def create_zarr_target(self):
with create_tmp_file(suffix=".zarr") as tmp:
yield tmp

@contextlib.contextmanager
def create_store(self, **kwargs):
with self.create_zarr_target() as store_target:
group = backends.ZarrStore.open_group(store_target, mode="a", **kwargs)
yield group

def test_write_store(self) -> None:
# This test is overriden from the base implementation because we need to ensure
# that the members cache is off, as the `ZarrStore` instance is re-used in the
# test function. Refactoring the base version of this test to
# if this test is refactored to no longer re-use the store object, then
# this implementation can be removed.

expected = create_test_data()
with self.create_store(cache_members=False) as store:
expected.dump_to_store(store)
# we need to cf decode the store because it has time and
# non-dimension coordinates
with xr.decode_cf(store) as actual:
assert_allclose(expected, actual)


@requires_zarr
class TestZarrWriteEmpty(TestZarrDirectoryStore):
Expand Down

0 comments on commit 8d31f0e

Please sign in to comment.