def test_cftimeindex_repr_formatting(periods, expected):
    """Test that cftimeindex.__repr__ is formatted similar to pd.Index.__repr__."""
    index = xr.date_range(start="2000", periods=periods, freq="D", use_cftime=True)
    expected = dedent(expected)
    assert expected == repr(index)
Test that cftimeindex.__repr__ is formatted similar to pd.Index.__repr__.
xarray/tests/test_cftimeindex.py