From d494b3539dcf4cb90ae8299d06782042610aa12a Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Tue, 21 Sep 2021 20:27:10 +0200 Subject: [PATCH] Prevent 3rd party lib from opening sockets in google_assistant tests (#56346) --- tests/components/google_assistant/test_http.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/components/google_assistant/test_http.py b/tests/components/google_assistant/test_http.py index 69a8242b7cc..013fa3c1d0c 100644 --- a/tests/components/google_assistant/test_http.py +++ b/tests/components/google_assistant/test_http.py @@ -153,6 +153,10 @@ async def test_report_state(hass, aioclient_mock, hass_storage): await config.async_connect_agent_user(agent_user_id) message = {"devices": {}} + with patch.object(config, "async_call_homegraph_api"): + # Wait for google_assistant.helpers.async_initialize.sync_google to be called + await hass.async_block_till_done() + with patch.object(config, "async_call_homegraph_api") as mock_call: await config.async_report_state(message, agent_user_id) mock_call.assert_called_once_with(