Fix async_track_utc_time_change firing too early (#42176)

This commit is contained in:
Anders Melchiorsen 2020-11-05 16:34:56 +01:00 committed by GitHub
parent ac06e871e4
commit 650c57db5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 80 additions and 71 deletions

View file

@ -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