Improve type hints in canary tests (#120305)
This commit is contained in:
parent
e3806d12f4
commit
aef2f7d707
1 changed files with 6 additions and 3 deletions
|
@ -4,16 +4,19 @@ from unittest.mock import MagicMock, patch
|
|||
|
||||
from canary.api import Api
|
||||
import pytest
|
||||
from typing_extensions import Generator
|
||||
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_ffmpeg(hass):
|
||||
def mock_ffmpeg(hass: HomeAssistant) -> None:
|
||||
"""Mock ffmpeg is loaded."""
|
||||
hass.config.components.add("ffmpeg")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def canary(hass):
|
||||
def canary() -> Generator[MagicMock]:
|
||||
"""Mock the CanaryApi for easier testing."""
|
||||
with (
|
||||
patch.object(Api, "login", return_value=True),
|
||||
|
@ -38,7 +41,7 @@ def canary(hass):
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
def canary_config_flow(hass):
|
||||
def canary_config_flow() -> Generator[MagicMock]:
|
||||
"""Mock the CanaryApi for easier config flow testing."""
|
||||
with (
|
||||
patch.object(Api, "login", return_value=True),
|
||||
|
|
Loading…
Add table
Reference in a new issue