|
42 | 42 | has_cftime,
|
43 | 43 | has_pandas_ge_2_2,
|
44 | 44 | requires_cftime,
|
| 45 | + requires_pandas_3, |
45 | 46 | )
|
46 | 47 |
|
47 | 48 | cftime = pytest.importorskip("cftime")
|
@@ -1354,7 +1355,7 @@ def test_calendar_specific_month_end_negative_freq(
|
1354 | 1355 | ) -> None:
|
1355 | 1356 | year = 2000 # Use a leap-year to highlight calendar differences
|
1356 | 1357 | result = cftime_range(
|
1357 |
| - start="2000-12", |
| 1358 | + start="2001", |
1358 | 1359 | end="2000",
|
1359 | 1360 | freq="-2ME",
|
1360 | 1361 | calendar=calendar,
|
@@ -1464,7 +1465,7 @@ def test_date_range_errors() -> None:
|
1464 | 1465 | ("2020-02-01", "QE-DEC", "noleap", "gregorian", True, "2020-03-31", True),
|
1465 | 1466 | ("2020-02-01", "YS-FEB", "noleap", "gregorian", True, "2020-02-01", True),
|
1466 | 1467 | ("2020-02-01", "YE-FEB", "noleap", "gregorian", True, "2020-02-29", True),
|
1467 |
| - ("2020-02-01", "-1YE-FEB", "noleap", "gregorian", True, "2020-02-29", True), |
| 1468 | + ("2020-02-01", "-1YE-FEB", "noleap", "gregorian", True, "2019-02-28", True), |
1468 | 1469 | ("2020-02-28", "3h", "all_leap", "gregorian", False, "2020-02-28", True),
|
1469 | 1470 | ("2020-03-30", "ME", "360_day", "gregorian", False, "2020-03-31", True),
|
1470 | 1471 | ("2020-03-31", "ME", "gregorian", "360_day", None, "2020-03-30", False),
|
@@ -1724,7 +1725,17 @@ def test_new_to_legacy_freq_pd_freq_passthrough(freq, expected):
|
1724 | 1725 | @pytest.mark.parametrize("start", ("2000", "2001"))
|
1725 | 1726 | @pytest.mark.parametrize("end", ("2000", "2001"))
|
1726 | 1727 | @pytest.mark.parametrize(
|
1727 |
| - "freq", ("MS", "-1MS", "YS", "-1YS", "ME", "-1ME", "YE", "-1YE") |
| 1728 | + "freq", |
| 1729 | + ( |
| 1730 | + "MS", |
| 1731 | + pytest.param("-1MS", marks=requires_pandas_3), |
| 1732 | + "YS", |
| 1733 | + pytest.param("-1YS", marks=requires_pandas_3), |
| 1734 | + "ME", |
| 1735 | + pytest.param("-1ME", marks=requires_pandas_3), |
| 1736 | + "YE", |
| 1737 | + pytest.param("-1YE", marks=requires_pandas_3), |
| 1738 | + ), |
1728 | 1739 | )
|
1729 | 1740 | def test_cftime_range_same_as_pandas(start, end, freq):
|
1730 | 1741 | result = date_range(start, end, freq=freq, calendar="standard", use_cftime=True)
|
|
0 commit comments