Fix async_track_utc_time_change firing too early (#42176)
This commit is contained in:
parent
ac06e871e4
commit
650c57db5b
6 changed files with 80 additions and 71 deletions
|
@ -15,7 +15,7 @@ from tests.components.light.conftest import mock_light_profiles # noqa
|
|||
def utcnow(request):
|
||||
"""Freeze time at a known point."""
|
||||
now = dt_util.utcnow()
|
||||
start_dt = datetime.datetime(now.year + 1, 1, 1, 0, 0, 0)
|
||||
start_dt = datetime.datetime(now.year + 1, 1, 1, 0, 0, 0, tzinfo=now.tzinfo)
|
||||
with mock.patch("homeassistant.util.dt.utcnow") as dt_utcnow:
|
||||
dt_utcnow.return_value = start_dt
|
||||
yield dt_utcnow
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue