Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Mar 28, 2024
1 parent 0dc71d4 commit 6d89099
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions xarray/tests/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -2467,7 +2467,6 @@ def test_group(self) -> None:
) as actual:
assert_identical(original, actual)

@requires_zarr
def test_zarr_mode_w_overwrites_encoding(self) -> None:
import zarr

Expand All @@ -2476,14 +2475,18 @@ def test_zarr_mode_w_overwrites_encoding(self) -> None:
data.to_zarr(
store, **self.version_kwargs, encoding={"foo": {"add_offset": 1}}
)
np.testing.assert_equal(zarr.open_group(store)["foo"], data.foo.data - 1)
np.testing.assert_equal(
zarr.open_group(store, **self.version_kwargs)["foo"], data.foo.data - 1
)
data.to_zarr(
store,
**self.version_kwargs,
encoding={"foo": {"add_offset": 0}},
mode="w",
)
np.testing.assert_equal(zarr.open_group(store)["foo"], data.foo.data)
np.testing.assert_equal(
zarr.open_group(store, **self.version_kwargs)["foo"], data.foo.data
)

def test_encoding_kwarg_fixed_width_string(self) -> None:
# not relevant for zarr, since we don't use EncodedStringCoder
Expand Down

0 comments on commit 6d89099

Please sign in to comment.