Skip to content

Commit 10b68c3

Browse files
authored
Fix test_doc_example on big-endian systems (#9949)
... by using a fixed-endian input.
1 parent 3ba4ce4 commit 10b68c3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: xarray/tests/test_datatree.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -1240,8 +1240,12 @@ def test_repr_inherited_dims(self) -> None:
12401240
)
12411241
def test_doc_example(self) -> None:
12421242
# regression test for https://github.com/pydata/xarray/issues/9499
1243-
time = xr.DataArray(data=["2022-01", "2023-01"], dims="time")
1244-
stations = xr.DataArray(data=list("abcdef"), dims="station")
1243+
time = xr.DataArray(
1244+
data=np.array(["2022-01", "2023-01"], dtype="<U7"), dims="time"
1245+
)
1246+
stations = xr.DataArray(
1247+
data=np.array(list("abcdef"), dtype="<U1"), dims="station"
1248+
)
12451249
lon = [-100, -80, -60]
12461250
lat = [10, 20, 30]
12471251
# Set up fake data

0 commit comments

Comments
 (0)