From cf4287cd0c2fc6cd3ea49abedb07d3fcc6b53f1c Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Mon, 7 Aug 2023 12:57:37 +0200 Subject: [PATCH] Fix alexa test RuntimeWarning (#97956) --- tests/components/alexa/test_smart_home.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/components/alexa/test_smart_home.py b/tests/components/alexa/test_smart_home.py index 317febcfdd1..d24ece9b48c 100644 --- a/tests/components/alexa/test_smart_home.py +++ b/tests/components/alexa/test_smart_home.py @@ -1,6 +1,6 @@ """Test for smart home alexa support.""" from typing import Any -from unittest.mock import AsyncMock, patch +from unittest.mock import AsyncMock, MagicMock, patch import pytest @@ -4393,6 +4393,7 @@ async def test_alexa_config( assert test_config.should_expose("sensor.test") assert not test_config.should_expose("switch.test") with patch.object(test_config, "_auth", AsyncMock()): + test_config._auth.async_invalidate_access_token = MagicMock() test_config.async_invalidate_access_token() assert len(test_config._auth.async_invalidate_access_token.mock_calls) await test_config.async_accept_grant("grant_code")