TST: add test with freq=2M to increase coverage of to_period
xref #52064

added a test in pandas/tests/indexes/datetimes/methods/test_to_period.py, which covers cases `freq=“2M"` and `freq=MonthEnd(2)` for `to_period` from DatetimeIndex. The reason: existing tests were all for `"freq='M'"`, rather than for `"freq='2M'"`.
@MarcoGorelli, could you please take a look at this pr?