mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 19:09:32 +00:00
Use eventloop for scheduling (#37184)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user