def test_cftimeindex_periods_repr(periods):
    """Test that cftimeindex has periods property in repr."""
    index = xr.date_range(start="2000", periods=periods, use_cftime=True)
    repr_str = index.__repr__()
    assert f" length={periods}" in repr_str
Test that cftimeindex has periods property in repr.
xarray/tests/test_cftimeindex.py