From 50f3a04855d7cf79ddf132ed07d74fb534e57f3a Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Wed, 11 Dec 2024 16:10:49 -0700 Subject: [PATCH] Fix/silence upstream tests 1. Fix numpy formatting test (Closes #9873) 2. xfail cftimeindex test (#9878) Closes #9810 --- xarray/tests/test_cftimeindex.py | 1 + xarray/tests/test_formatting.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xarray/tests/test_cftimeindex.py b/xarray/tests/test_cftimeindex.py index 116487e2bcf..e34714a344a 100644 --- a/xarray/tests/test_cftimeindex.py +++ b/xarray/tests/test_cftimeindex.py @@ -1188,6 +1188,7 @@ def test_to_datetimeindex_feb_29(calendar): index.to_datetimeindex() +@pytest.mark.xfail(reason="fails on pandas main branch") @requires_cftime def test_multiindex(): index = xr.cftime_range("2001-01-01", periods=100, calendar="360_day") diff --git a/xarray/tests/test_formatting.py b/xarray/tests/test_formatting.py index 946d491bd61..9b658fa0d66 100644 --- a/xarray/tests/test_formatting.py +++ b/xarray/tests/test_formatting.py @@ -1020,9 +1020,10 @@ def test_display_nbytes() -> None: assert actual == expected actual = repr(xds["foo"]) - expected = """ + array_repr = repr(xds.foo.data).replace("\n ", "") + expected = f""" Size: 2kB -array([ 0, 1, 2, ..., 1197, 1198, 1199], dtype=int16) +{array_repr} Coordinates: * foo (foo) int16 2kB 0 1 2 3 4 5 6 ... 1194 1195 1196 1197 1198 1199 """.strip()