diff --git a/xarray/tests/test_datatree.py b/xarray/tests/test_datatree.py index 66ea24fddb7..2adf73fa5c8 100644 --- a/xarray/tests/test_datatree.py +++ b/xarray/tests/test_datatree.py @@ -1,4 +1,5 @@ import re +import sys import typing from copy import copy, deepcopy from textwrap import dedent @@ -15,6 +16,8 @@ from xarray.testing import assert_equal, assert_identical from xarray.tests import assert_array_equal, create_test_data, source_ndarray +ON_WINDOWS = sys.platform == "win32" + class TestTreeCreation: def test_empty(self): @@ -1052,7 +1055,7 @@ def test_repr_two_children(self): { "/": Dataset(coords={"x": [1.0]}), "/first_child": None, - "/second_child": Dataset({"foo": ("x", [0.0])}, coords={"z": 1}), + "/second_child": Dataset({"foo": ("x", [0.0])}, coords={"z": 1.0}), } ) @@ -1068,7 +1071,7 @@ def test_repr_two_children(self): └── Group: /second_child Dimensions: (x: 1) Coordinates: - z int64 8B 1 + z float64 8B 1.0 Data variables: foo (x) float64 8B 0.0 """ @@ -1094,7 +1097,7 @@ def test_repr_two_children(self): Group: /second_child Dimensions: (x: 1) Coordinates: - z int64 8B 1 + z float64 8B 1.0 Inherited coordinates: * x (x) float64 8B 1.0 Data variables: @@ -1142,6 +1145,9 @@ def test_repr_inherited_dims(self): ).strip() assert result == expected + @pytest.mark.skipif( + ON_WINDOWS, reason="windows (pre NumPy2) uses int32 instead of int64" + ) def test_doc_example(self): # regression test for https://github.com/pydata/xarray/issues/9499 time = xr.DataArray(data=["2022-01", "2023-01"], dims="time")