mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fix flakey airzone_cloud tests by avoiding creation of the websocket (#112102)
This commit is contained in:
parent
2f223ae377
commit
25ba046ff1
15
tests/components/airzone_cloud/conftest.py
Normal file
15
tests/components/airzone_cloud/conftest.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
"""Tests for the Airzone integration."""
|
||||||
|
|
||||||
|
from unittest.mock import patch
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def airzone_cloud_no_websockets():
|
||||||
|
"""Fixture to completely disable Airzone Cloud WebSockets."""
|
||||||
|
with patch(
|
||||||
|
"homeassistant.components.airzone_cloud.AirzoneCloudApi._update_websockets",
|
||||||
|
return_value=False,
|
||||||
|
), patch("aioairzone_cloud.websockets.AirzoneCloudIWS.connect", return_value=True):
|
||||||
|
yield
|
@ -46,9 +46,6 @@ async def test_coordinator_client_connector_error(hass: HomeAssistant) -> None:
|
|||||||
) as mock_webserver, patch(
|
) as mock_webserver, patch(
|
||||||
"homeassistant.components.airzone_cloud.AirzoneCloudApi.login",
|
"homeassistant.components.airzone_cloud.AirzoneCloudApi.login",
|
||||||
return_value=None,
|
return_value=None,
|
||||||
), patch(
|
|
||||||
"homeassistant.components.airzone_cloud.AirzoneCloudApi._update_websockets",
|
|
||||||
return_value=False,
|
|
||||||
):
|
):
|
||||||
await hass.config_entries.async_setup(config_entry.entry_id)
|
await hass.config_entries.async_setup(config_entry.entry_id)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user