mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix flaky statistics tests (#51242)
This commit is contained in:
parent
c5e5787e1d
commit
27b9d7fed0
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user