(month_label, month_int, multiple, offset_str)
| 271 | @pytest.mark.parametrize("offset_str", ["AS", "A", "YS", "Y"]) |
| 272 | @pytest.mark.filterwarnings("ignore::FutureWarning") # Deprecation of "A" etc. |
| 273 | def test_to_offset_annual(month_label, month_int, multiple, offset_str): |
| 274 | freq = offset_str |
| 275 | offset_type = _ANNUAL_OFFSET_TYPES[offset_str] |
| 276 | if month_label: |
| 277 | freq = f"{freq}-{month_label}" |
| 278 | if multiple: |
| 279 | freq = f"{multiple}{freq}" |
| 280 | result = to_offset(freq) |
| 281 | |
| 282 | if multiple and month_int: |
| 283 | expected = offset_type(n=multiple, month=month_int) |
| 284 | elif multiple: |
| 285 | expected = offset_type(n=multiple) |
| 286 | elif month_int: |
| 287 | expected = offset_type(month=month_int) |
| 288 | else: |
| 289 | expected = offset_type() |
| 290 | assert result == expected |
| 291 | |
| 292 | |
| 293 | _QUARTER_OFFSET_TYPES = {"Q": QuarterEnd, "QS": QuarterBegin, "QE": QuarterEnd} |
nothing calls this directly
no test coverage detected
searching dependent graphs…