@pytest.mark.parametrize('freq', [None, 'D'])
def test_sub_period(self, freq):
    p = pd.Period('2011-01-01', freq='D')
    idx = pd.DatetimeIndex(['2011-01-01', '2011-01-02'], freq=freq)
    with pytest.raises(TypeError):
        (idx - p)
    with pytest.raises(TypeError):
        (p - idx)
@pytest.mark.parametrize('freq', [None, 'D'])
def test_sub_period(self, freq):
    p = pd.Period('2011-01-01', freq='D')
    idx = pd.DatetimeIndex(['2011-01-01', '2011-01-02'], freq=freq)
    with pytest.raises(TypeError):
        (idx - p)
    with pytest.raises(TypeError):
        (p - idx)