From bb45b23ba9252d4570127f11877d9c3ca7c6b2a6 Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Mon, 26 Jan 2026 12:30:17 +0100 Subject: [PATCH] Small cleanup in sensors test for system monitor (#161616) --- tests/components/systemmonitor/test_sensor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/components/systemmonitor/test_sensor.py b/tests/components/systemmonitor/test_sensor.py index 496c29aa7b7..7643d24770b 100644 --- a/tests/components/systemmonitor/test_sensor.py +++ b/tests/components/systemmonitor/test_sensor.py @@ -2,7 +2,7 @@ from datetime import timedelta import socket -from unittest.mock import Mock, PropertyMock, patch +from unittest.mock import Mock, patch from freezegun.api import FrozenDateTimeFactory from psutil._common import sdiskpart, sdiskusage, shwtemp, snetio, snicaddr @@ -664,7 +664,7 @@ async def test_sensor_with_param_exception( entity_id: str, ) -> None: """Test the sensor.""" - setattr(mock_psutil, psutil_attr, PropertyMock(side_effect=exception)) + setattr(mock_psutil, psutil_attr, Mock(side_effect=exception)) mock_config_entry.add_to_hass(hass) await hass.config_entries.async_setup(mock_config_entry.entry_id) await hass.async_block_till_done() @@ -697,7 +697,7 @@ async def test_sensor_without_param_exception( entity_id: str, ) -> None: """Test the sensor.""" - setattr(mock_psutil, psutil_attr, PropertyMock(side_effect=exception)) + setattr(mock_psutil, psutil_attr, Mock(side_effect=exception)) mock_config_entry.add_to_hass(hass) await hass.config_entries.async_setup(mock_config_entry.entry_id) await hass.async_block_till_done()