def test_cftimeindex_calendar_repr(calendar, expected):
    """Test that cftimeindex has calendar property in repr."""
    index = xr.date_range(start="2000", periods=3, calendar=calendar, use_cftime=True)
    repr_str = index.__repr__()
    assert f" calendar='{expected}'" in repr_str
    assert "2000-01-01 00:00:00, 2000-01-02 00:00:00" in repr_str
Test that cftimeindex has calendar property in repr.
xarray/tests/test_cftimeindex.py