Improve type hints in demo tests (#120387)

This commit is contained in:
epenet
2024-06-25 09:55:59 +02:00
committed by GitHub
parent 6fb400f76b
commit 7f20c1a489
8 changed files with 40 additions and 32 deletions

View File

@@ -3,6 +3,7 @@
from unittest.mock import patch
import pytest
from typing_extensions import Generator
import voluptuous as vol
from homeassistant.components.climate import (
@@ -50,7 +51,7 @@ ENTITY_HEATPUMP = "climate.heatpump"
@pytest.fixture
async def climate_only() -> None:
def climate_only() -> Generator[None]:
"""Enable only the climate platform."""
with patch(
"homeassistant.components.demo.COMPONENTS_WITH_CONFIG_ENTRY_DEMO_PLATFORM",
@@ -60,7 +61,7 @@ async def climate_only() -> None:
@pytest.fixture(autouse=True)
async def setup_demo_climate(hass, climate_only):
async def setup_demo_climate(hass: HomeAssistant, climate_only: None) -> None:
"""Initialize setup demo climate."""
hass.config.units = METRIC_SYSTEM
assert await async_setup_component(hass, DOMAIN, {"climate": {"platform": "demo"}})