Fix flakey airzone_cloud tests by avoiding creation of the websocket (#112102)

pull/112111/head
Álvaro Fernández Rojas 2024-03-03 10:56:14 +00:00 committed by GitHub
parent 2f223ae377
commit 25ba046ff1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 3 deletions

View 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

View File

@ -46,9 +46,6 @@ async def test_coordinator_client_connector_error(hass: HomeAssistant) -> None:
) as mock_webserver, patch(
"homeassistant.components.airzone_cloud.AirzoneCloudApi.login",
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.async_block_till_done()