Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Erik
cc10e8ac7c Don't patch homeassistant.runner.monotonic in tests 2024-06-26 15:42:07 +02:00

View file

@ -3,9 +3,8 @@
from __future__ import annotations
import datetime
import time
from homeassistant import runner, util
from homeassistant import util
from homeassistant.helpers import event as event_helper
from homeassistant.util import dt as dt_util
@ -15,14 +14,7 @@ def _utcnow() -> datetime.datetime:
return datetime.datetime.now(datetime.UTC)
def _monotonic() -> float:
"""Make monotonic patchable by freezegun."""
return time.monotonic()
# Replace partial functions which are not found by freezegun
dt_util.utcnow = _utcnow # type: ignore[assignment]
event_helper.time_tracker_utcnow = _utcnow # type: ignore[assignment]
util.utcnow = _utcnow # type: ignore[assignment]
runner.monotonic = _monotonic # type: ignore[assignment]