Skip to content

Commit

Permalink
Silence deprecation warning from .dims in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty committed Jan 22, 2024
1 parent 32c1645 commit 0e5d202
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion xarray/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,11 @@ def test_properties(self) -> None:
# TODO change after deprecation cycle in GH #8500 is complete
assert isinstance(ds.dims.mapping, dict)
assert type(ds.dims.mapping) is dict # noqa: E721
assert ds.dims == ds.sizes
with pytest.warns(
FutureWarning,
match=" To access a mapping from dimension names to lengths, please use `Dataset.sizes`",
):
assert ds.dims == ds.sizes
assert ds.sizes == {"dim1": 8, "dim2": 9, "dim3": 10, "time": 20}

# dtypes
Expand Down

0 comments on commit 0e5d202

Please sign in to comment.