Fix lg_thinq RuntimeWarning in tests (#143448)

This commit is contained in:
Marc Mueller 2025-04-22 14:22:04 +02:00 committed by GitHub
parent aedd60e74f
commit 72337e4c77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

@ -94,7 +94,7 @@ def mock_invalid_thinq_api(mock_config_thinq_api: AsyncMock) -> AsyncMock:
@pytest.fixture
def mock_thinq_api() -> Generator[AsyncMock]:
def mock_thinq_api(mock_thinq_mqtt_client: None) -> Generator[AsyncMock]:
"""Mock a thinq api."""
with patch("homeassistant.components.lg_thinq.ThinQApi", autospec=True) as mock_api:
thinq_api = mock_api.return_value
@ -111,7 +111,7 @@ def mock_thinq_api() -> Generator[AsyncMock]:
@pytest.fixture
def mock_thinq_mqtt_client() -> Generator[AsyncMock]:
def mock_thinq_mqtt_client() -> Generator[None]:
"""Mock a thinq mqtt client."""
with patch(
"homeassistant.components.lg_thinq.mqtt.ThinQMQTTClient",

View File

@ -15,7 +15,6 @@ from tests.common import MockConfigEntry
async def test_load_unload_entry(
hass: HomeAssistant,
mock_thinq_api: AsyncMock,
mock_thinq_mqtt_client: AsyncMock,
mock_config_entry: MockConfigEntry,
) -> None:
"""Test load and unload entry."""
@ -37,7 +36,6 @@ async def test_load_unload_entry(
async def test_config_not_ready(
hass: HomeAssistant,
mock_thinq_api: AsyncMock,
mock_thinq_mqtt_client: AsyncMock,
mock_config_entry: MockConfigEntry,
exception: Exception,
) -> None: