mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Make freezegun find event.time_tracker_utcnow (#116284)
This commit is contained in:
parent
7715bee6b0
commit
b94b93cc63
@ -6,6 +6,7 @@ import datetime
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
from homeassistant import runner, util
|
from homeassistant import runner, util
|
||||||
|
from homeassistant.helpers import event as event_helper
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
|
|
||||||
@ -19,6 +20,9 @@ def _monotonic() -> float:
|
|||||||
return time.monotonic()
|
return time.monotonic()
|
||||||
|
|
||||||
|
|
||||||
|
# Replace partial functions which are not found by freezegun
|
||||||
dt_util.utcnow = _utcnow # type: ignore[assignment]
|
dt_util.utcnow = _utcnow # type: ignore[assignment]
|
||||||
|
event_helper.time_tracker_utcnow = _utcnow # type: ignore[assignment]
|
||||||
util.utcnow = _utcnow # type: ignore[assignment]
|
util.utcnow = _utcnow # type: ignore[assignment]
|
||||||
|
|
||||||
runner.monotonic = _monotonic # type: ignore[assignment]
|
runner.monotonic = _monotonic # type: ignore[assignment]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user