Improve type hints in demo tests (#120387)
This commit is contained in:
parent
6fb400f76b
commit
7f20c1a489
8 changed files with 40 additions and 32 deletions
|
@ -3,6 +3,7 @@
|
|||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from typing_extensions import Generator
|
||||
|
||||
from homeassistant.components.camera import (
|
||||
DOMAIN as CAMERA_DOMAIN,
|
||||
|
@ -24,7 +25,7 @@ ENTITY_CAMERA = "camera.demo_camera"
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
async def camera_only() -> None:
|
||||
def camera_only() -> Generator[None]:
|
||||
"""Enable only the button platform."""
|
||||
with patch(
|
||||
"homeassistant.components.demo.COMPONENTS_WITH_CONFIG_ENTRY_DEMO_PLATFORM",
|
||||
|
@ -34,7 +35,7 @@ async def camera_only() -> None:
|
|||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
async def demo_camera(hass, camera_only):
|
||||
async def demo_camera(hass: HomeAssistant, camera_only: None) -> None:
|
||||
"""Initialize a demo camera platform."""
|
||||
assert await async_setup_component(
|
||||
hass, CAMERA_DOMAIN, {CAMERA_DOMAIN: {"platform": DOMAIN}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue