From 9f15e7dcf4c0009954874a7fe35abb5a11c71094 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 8 Dec 2021 10:50:56 +0100 Subject: [PATCH] Fix flaky tests around frame helper (#61179) Co-authored-by: epenet --- tests/helpers/test_aiohttp_client.py | 2 ++ tests/helpers/test_httpx_client.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/helpers/test_aiohttp_client.py b/tests/helpers/test_aiohttp_client.py index f68c7ba2181..bfd933a4afd 100644 --- a/tests/helpers/test_aiohttp_client.py +++ b/tests/helpers/test_aiohttp_client.py @@ -107,6 +107,7 @@ async def test_get_clientsession_patched_close(hass): assert mock_close.call_count == 0 +@patch("homeassistant.helpers.frame._REPORTED_INTEGRATIONS", set()) async def test_warning_close_session_integration(hass, caplog): """Test log warning message when closing the session from integration context.""" with patch( @@ -138,6 +139,7 @@ async def test_warning_close_session_integration(hass, caplog): ) in caplog.text +@patch("homeassistant.helpers.frame._REPORTED_INTEGRATIONS", set()) async def test_warning_close_session_custom(hass, caplog): """Test log warning message when closing the session from custom context.""" with patch( diff --git a/tests/helpers/test_httpx_client.py b/tests/helpers/test_httpx_client.py index a47463b6b98..cdb650f7686 100644 --- a/tests/helpers/test_httpx_client.py +++ b/tests/helpers/test_httpx_client.py @@ -93,6 +93,7 @@ async def test_get_async_client_context_manager(hass): assert mock_aclose.call_count == 0 +@patch("homeassistant.helpers.frame._REPORTED_INTEGRATIONS", set()) async def test_warning_close_session_integration(hass, caplog): """Test log warning message when closing the session from integration context.""" with patch( @@ -125,6 +126,7 @@ async def test_warning_close_session_integration(hass, caplog): ) in caplog.text +@patch("homeassistant.helpers.frame._REPORTED_INTEGRATIONS", set()) async def test_warning_close_session_custom(hass, caplog): """Test log warning message when closing the session from custom context.""" with patch(