Use eventloop for scheduling (#37184)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
J. Nick Koston
2020-06-29 11:39:24 -05:00
committed by GitHub
parent 0f72008090
commit 89a9634d35
42 changed files with 366 additions and 272 deletions

View File

@@ -5,13 +5,16 @@ from unittest import mock
from aiohomekit.testing import FakeController
import pytest
import homeassistant.util.dt as dt_util
import tests.async_mock
@pytest.fixture
def utcnow(request):
"""Freeze time at a known point."""
start_dt = datetime.datetime(2019, 1, 1, 0, 0, 0)
now = dt_util.utcnow()
start_dt = datetime.datetime(now.year + 1, 1, 1, 0, 0, 0)
with mock.patch("homeassistant.util.dt.utcnow") as dt_utcnow:
dt_utcnow.return_value = start_dt
yield dt_utcnow