def METHOD_NAME():
    # with pytest.raises(IndexError):
    timeindex_one = pd.date_range("1/1/2019", periods=1, freq="H")
    timeindex_hourly = pd.date_range("1/1/2019", periods=3, freq="H")
    timeindex_45mins = pd.date_range("1/1/2019", periods=2, freq="45min")
    timeindex1 = timeindex_one.append(timeindex_hourly)
    timeindex2 = timeindex_hourly.append([timeindex_45mins])
    with pytest.raises(TypeError):
        solph.EnergySystem(timeindex=timeindex1, infer_last_interval=False)
    with pytest.raises(TypeError):
        solph.EnergySystem(timeindex=timeindex2, infer_last_interval=False)