From 653b73c6017eabdf04f4e630a9370607be2c86fb Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Wed, 1 Oct 2025 14:26:09 +0200 Subject: [PATCH] Fix device_automation RuntimeWarning in tests (#153319) --- tests/components/device_automation/test_init.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/components/device_automation/test_init.py b/tests/components/device_automation/test_init.py index 456202a63a4..c04dd242e61 100644 --- a/tests/components/device_automation/test_init.py +++ b/tests/components/device_automation/test_init.py @@ -1,6 +1,6 @@ """The test for light device automation.""" -from unittest.mock import AsyncMock, Mock, patch +from unittest.mock import AsyncMock, MagicMock, Mock, patch import attr import pytest @@ -1088,7 +1088,7 @@ async def test_automation_with_dynamically_validated_condition( module_cache = hass.data[loader.DATA_COMPONENTS] module = module_cache["fake_integration.device_condition"] - module.async_validate_condition_config = AsyncMock() + module.async_validate_condition_config = AsyncMock(return_value=MagicMock()) config_entry = MockConfigEntry(domain="fake_integration", data={}) config_entry.mock_state(hass, ConfigEntryState.LOADED)