From 270594b8a6d78ebb35c8b05c05d3926e84c81815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20Sch=C3=B6nfeldt?= Date: Fri, 22 Dec 2023 12:22:35 +0100 Subject: [PATCH] Add test for warnings when infer_last_interval is missing --- tests/test_time_index.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_time_index.py b/tests/test_time_index.py index db4049a1b..bbd388e75 100644 --- a/tests/test_time_index.py +++ b/tests/test_time_index.py @@ -29,6 +29,12 @@ def test_energysystem_with_datetimeindex(): assert es.timeincrement.sum() == 23 +def test_energysystem_with_datetimeindex(): + datetimeindex = pd.date_range("1/1/2012", periods=24, freq="H") + with pytest.warns(FutureWarning): + _ = solph.EnergySystem(timeindex=datetimeindex) + + def test_energysystem_with_datetimeindex_non_equidistant_infer_last_interval(): """Test EnergySystem with DatetimeIndex (non-equidistant)""" dtindex1 = pd.date_range("1/1/2012", periods=24, freq="H")