From d034ed1fc209868d3e96dfb4c623ad5c68e79093 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Wed, 17 Aug 2022 13:54:54 +0200 Subject: [PATCH] Remove some error prone code from Alexa tests (#76917) --- tests/components/alexa/test_smart_home.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/components/alexa/test_smart_home.py b/tests/components/alexa/test_smart_home.py index df45d90358b..d04b3719bf9 100644 --- a/tests/components/alexa/test_smart_home.py +++ b/tests/components/alexa/test_smart_home.py @@ -26,10 +26,11 @@ from homeassistant.components.media_player.const import ( ) import homeassistant.components.vacuum as vacuum from homeassistant.config import async_process_ha_core_config -from homeassistant.const import STATE_UNKNOWN, TEMP_CELSIUS, TEMP_FAHRENHEIT +from homeassistant.const import STATE_UNKNOWN, TEMP_FAHRENHEIT from homeassistant.core import Context from homeassistant.helpers import entityfilter from homeassistant.setup import async_setup_component +from homeassistant.util.unit_system import IMPERIAL_SYSTEM from .test_common import ( MockConfig, @@ -2019,7 +2020,7 @@ async def test_unknown_sensor(hass): async def test_thermostat(hass): """Test thermostat discovery.""" - hass.config.units.temperature_unit = TEMP_FAHRENHEIT + hass.config.units = IMPERIAL_SYSTEM device = ( "climate.test_thermostat", "cool", @@ -2287,9 +2288,6 @@ async def test_thermostat(hass): ) assert call.data["preset_mode"] == "eco" - # Reset config temperature_unit back to CELSIUS, required for additional tests outside this component. - hass.config.units.temperature_unit = TEMP_CELSIUS - async def test_exclude_filters(hass): """Test exclusion filters."""