diff --git a/tests/test_battery_capacity.py b/tests/test_battery_capacity.py index e0ba2666..96ba9f03 100644 --- a/tests/test_battery_capacity.py +++ b/tests/test_battery_capacity.py @@ -161,6 +161,7 @@ async def database_case(config_eos): from akkudoktoreos.core.coreabc import get_measurement from akkudoktoreos.measurement.quality import MeasurementSample + get_measurement()._db_reset_state() config_eos.merge_settings_from_dict( { "devices": { @@ -197,7 +198,10 @@ async def database_case(config_eos): for t in (0, 1800, 3600) ] )) - return config_eos + try: + yield config_eos + finally: + get_measurement()._db_reset_state() def test_http_reads_database_and_stores_only_explicit_estimate(database_case):