mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Fix lg_thinq RuntimeWarning in tests (#143448)
This commit is contained in:
parent
aedd60e74f
commit
72337e4c77
@ -94,7 +94,7 @@ def mock_invalid_thinq_api(mock_config_thinq_api: AsyncMock) -> AsyncMock:
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def mock_thinq_api() -> Generator[AsyncMock]:
|
def mock_thinq_api(mock_thinq_mqtt_client: None) -> Generator[AsyncMock]:
|
||||||
"""Mock a thinq api."""
|
"""Mock a thinq api."""
|
||||||
with patch("homeassistant.components.lg_thinq.ThinQApi", autospec=True) as mock_api:
|
with patch("homeassistant.components.lg_thinq.ThinQApi", autospec=True) as mock_api:
|
||||||
thinq_api = mock_api.return_value
|
thinq_api = mock_api.return_value
|
||||||
@ -111,7 +111,7 @@ def mock_thinq_api() -> Generator[AsyncMock]:
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def mock_thinq_mqtt_client() -> Generator[AsyncMock]:
|
def mock_thinq_mqtt_client() -> Generator[None]:
|
||||||
"""Mock a thinq mqtt client."""
|
"""Mock a thinq mqtt client."""
|
||||||
with patch(
|
with patch(
|
||||||
"homeassistant.components.lg_thinq.mqtt.ThinQMQTTClient",
|
"homeassistant.components.lg_thinq.mqtt.ThinQMQTTClient",
|
||||||
|
@ -15,7 +15,6 @@ from tests.common import MockConfigEntry
|
|||||||
async def test_load_unload_entry(
|
async def test_load_unload_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mock_thinq_api: AsyncMock,
|
mock_thinq_api: AsyncMock,
|
||||||
mock_thinq_mqtt_client: AsyncMock,
|
|
||||||
mock_config_entry: MockConfigEntry,
|
mock_config_entry: MockConfigEntry,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test load and unload entry."""
|
"""Test load and unload entry."""
|
||||||
@ -37,7 +36,6 @@ async def test_load_unload_entry(
|
|||||||
async def test_config_not_ready(
|
async def test_config_not_ready(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mock_thinq_api: AsyncMock,
|
mock_thinq_api: AsyncMock,
|
||||||
mock_thinq_mqtt_client: AsyncMock,
|
|
||||||
mock_config_entry: MockConfigEntry,
|
mock_config_entry: MockConfigEntry,
|
||||||
exception: Exception,
|
exception: Exception,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user