From a4007d2c5b5120d47f8b2b556568a61fe033a497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20M=C3=BChlbauer?= Date: Fri, 13 Dec 2024 12:56:20 +0100 Subject: [PATCH] fix tests --- xarray/tests/test_cftime_offsets.py | 39 ----------------------------- 1 file changed, 39 deletions(-) diff --git a/xarray/tests/test_cftime_offsets.py b/xarray/tests/test_cftime_offsets.py index f6f97108c1d..01b3bda7097 100644 --- a/xarray/tests/test_cftime_offsets.py +++ b/xarray/tests/test_cftime_offsets.py @@ -1294,13 +1294,6 @@ def test_invalid_cftime_range_inputs( cftime_range(start, end, periods, freq, inclusive=inclusive) # type: ignore[arg-type] -def test_invalid_cftime_arg() -> None: - with pytest.warns( - FutureWarning, match="Following pandas, the `closed` parameter is deprecated" - ): - cftime_range("2000", "2001", None, "YE", closed="left") - - _CALENDAR_SPECIFIC_MONTH_END_TESTS = [ ("noleap", [(2, 28), (4, 30), (6, 30), (8, 31), (10, 31), (12, 31)]), ("all_leap", [(2, 29), (4, 30), (6, 30), (8, 31), (10, 31), (12, 31)]), @@ -1534,15 +1527,6 @@ def as_timedelta_not_implemented_error(): tick.as_timedelta() -@pytest.mark.parametrize("function", [cftime_range, date_range]) -def test_cftime_or_date_range_closed_and_inclusive_error(function: Callable) -> None: - if function == cftime_range and not has_cftime: - pytest.skip("requires cftime") - - with pytest.raises(ValueError, match="Following pandas, deprecated"): - function("2000", periods=3, closed=None, inclusive="right") - - @pytest.mark.parametrize("function", [cftime_range, date_range]) def test_cftime_or_date_range_invalid_inclusive_value(function: Callable) -> None: if function == cftime_range and not has_cftime: @@ -1552,29 +1536,6 @@ def test_cftime_or_date_range_invalid_inclusive_value(function: Callable) -> Non function("2000", periods=3, inclusive="foo") -@pytest.mark.parametrize( - "function", - [ - pytest.param(cftime_range, id="cftime", marks=requires_cftime), - pytest.param(date_range, id="date"), - ], -) -@pytest.mark.parametrize( - ("closed", "inclusive"), [(None, "both"), ("left", "left"), ("right", "right")] -) -def test_cftime_or_date_range_closed( - function: Callable, - closed: Literal["left", "right", None], - inclusive: Literal["left", "right", "both"], -) -> None: - with pytest.warns(FutureWarning, match="Following pandas"): - result_closed = function("2000-01-01", "2000-01-04", freq="D", closed=closed) - result_inclusive = function( - "2000-01-01", "2000-01-04", freq="D", inclusive=inclusive - ) - np.testing.assert_equal(result_closed.values, result_inclusive.values) - - @pytest.mark.parametrize("function", [cftime_range, date_range]) def test_cftime_or_date_range_inclusive_None(function) -> None: if function == cftime_range and not has_cftime: