mirror of
https://github.com/home-assistant/core.git
synced 2025-11-15 05:50:13 +00:00
Use async_timeout instead of asyncio.wait_for (#90496)
* Use async_timeout instead of asyncio.wait_for * fix imports * fix imports * break out Event.wait patch * Update tests/components/reolink/conftest.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Simplify --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
@@ -39,8 +39,6 @@ def reolink_connect(mock_get_source_ip: None) -> Generator[MagicMock, None, None
|
||||
with patch(
|
||||
"homeassistant.components.reolink.host.webhook.async_register",
|
||||
return_value=True,
|
||||
), patch(
|
||||
"homeassistant.components.reolink.host.asyncio.Event.wait", AsyncMock()
|
||||
), patch(
|
||||
"homeassistant.components.reolink.host.Host", autospec=True
|
||||
) as host_mock_class:
|
||||
@@ -65,6 +63,13 @@ def reolink_connect(mock_get_source_ip: None) -> Generator[MagicMock, None, None
|
||||
yield host_mock
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def reolink_ONVIF_wait() -> Generator[None, None, None]:
|
||||
"""Mock reolink connection."""
|
||||
with patch("homeassistant.components.reolink.host.asyncio.Event.wait", AsyncMock()):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def reolink_platforms(mock_get_source_ip: None) -> Generator[None, None, None]:
|
||||
"""Mock reolink entry setup."""
|
||||
|
||||
Reference in New Issue
Block a user