From 07a52aef59eb204916384bdeb090acc4f7f41d1e Mon Sep 17 00:00:00 2001 From: Michael Niklas Date: Sat, 13 Jul 2024 23:10:14 +0200 Subject: [PATCH] fix a broken test --- xarray/tests/test_concat.py | 2 +- xarray/tests/test_dataset.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/xarray/tests/test_concat.py b/xarray/tests/test_concat.py index 0c570de3b52..f6d17d6a08a 100644 --- a/xarray/tests/test_concat.py +++ b/xarray/tests/test_concat.py @@ -515,7 +515,7 @@ def test_concat_merge_variables_present_in_some_datasets(self, data) -> None: assert_identical(expected, actual) @pytest.mark.parametrize("data", [False], indirect=["data"]) - def test_concat_2(self, data) -> None: + def test_concat_2(self, data: Dataset) -> None: dim = "dim2" datasets = [g.squeeze(dim) for _, g in data.groupby(dim, squeeze=False)] concat_over = [k for k, v in data.coords.items() if dim in v.dims and k != dim] diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index 1ba45616ab0..4db005ca3fb 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -581,7 +581,8 @@ def test_constructor_pandas_single(self) -> None: pandas_obj = a.to_pandas() ds_based_on_pandas = Dataset(pandas_obj) # type: ignore # TODO: improve typing of __init__ for dim in ds_based_on_pandas.data_vars: - assert_array_equal(ds_based_on_pandas[dim], pandas_obj[str(dim)]) + assert isinstance(dim, int) + assert_array_equal(ds_based_on_pandas[dim], pandas_obj[dim]) def test_constructor_compat(self) -> None: data = {"x": DataArray(0, coords={"y": 1}), "y": ("z", [1, 1, 1])}