Fix flaky statistics tests (#51242)

This commit is contained in:
Erik Montnemery
2021-05-29 16:00:36 +02:00
committed by Paulus Schoutsen
parent 99fd5be369
commit 8fd3761893

View File

@@ -5,6 +5,7 @@ import json
from unittest.mock import patch, sentinel from unittest.mock import patch, sentinel
import pytest import pytest
from pytest import approx
from homeassistant.components import history, recorder from homeassistant.components import history, recorder
from homeassistant.components.recorder.history import get_significant_states from homeassistant.components.recorder.history import get_significant_states
@@ -884,9 +885,9 @@ async def test_statistics_during_period(hass, hass_ws_client):
{ {
"statistic_id": "sensor.test", "statistic_id": "sensor.test",
"start": now.isoformat(), "start": now.isoformat(),
"mean": 10.0, "mean": approx(10.0),
"min": 10.0, "min": approx(10.0),
"max": 10.0, "max": approx(10.0),
"last_reset": None, "last_reset": None,
"state": None, "state": None,
"sum": None, "sum": None,