Skip to content

Commit

Permalink
skip failing test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
shoyer committed Sep 22, 2024
1 parent bcb5185 commit 264e837
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions xarray/tests/test_datatree.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re
import sys
import typing
from copy import copy, deepcopy
from textwrap import dedent
Expand All @@ -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):
Expand Down Expand Up @@ -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}),
}
)

Expand All @@ -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
"""
Expand All @@ -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:
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 264e837

Please sign in to comment.