Add missing return type in test __init__ method (part 3) (#123940)

This commit is contained in:
epenet 2024-08-14 17:38:30 +02:00 committed by GitHub
parent 5e6f8373e1
commit 178482068d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 6 deletions

View File

@ -7,7 +7,7 @@ import pytest
from homeassistant.components.alexa import config, smart_home
from homeassistant.components.alexa.const import CONF_ENDPOINT, CONF_FILTER, CONF_LOCALE
from homeassistant.core import Context, callback
from homeassistant.core import Context, HomeAssistant, callback
from homeassistant.helpers import entityfilter
from tests.common import async_mock_service
@ -28,7 +28,7 @@ class MockConfig(smart_home.AlexaConfig):
"camera.test": {"display_categories": "CAMERA"},
}
def __init__(self, hass):
def __init__(self, hass: HomeAssistant) -> None:
"""Mock Alexa config."""
super().__init__(
hass,

View File

@ -124,7 +124,12 @@ def config_flow_handler(
class OAuthFixture:
"""Fixture to facilitate testing an OAuth flow."""
def __init__(self, hass, hass_client, aioclient_mock):
def __init__(
self,
hass: HomeAssistant,
hass_client: ClientSessionGenerator,
aioclient_mock: AiohttpClientMocker,
) -> None:
"""Initialize OAuthFixture."""
self.hass = hass
self.hass_client = hass_client

View File

@ -17,7 +17,7 @@ from homeassistant.core import HomeAssistant
class SimpleMediaPlayer(mp.MediaPlayerEntity):
"""Media player test class."""
def __init__(self, hass):
def __init__(self, hass: HomeAssistant) -> None:
"""Initialize the test media player."""
self.hass = hass
self._volume = 0

View File

@ -56,7 +56,12 @@ def nest_test_config() -> NestTestConfig:
class OAuthFixture:
"""Simulate the oauth flow used by the config flow."""
def __init__(self, hass, hass_client_no_auth, aioclient_mock):
def __init__(
self,
hass: HomeAssistant,
hass_client_no_auth: ClientSessionGenerator,
aioclient_mock: AiohttpClientMocker,
) -> None:
"""Initialize OAuthFixture."""
self.hass = hass
self.hass_client = hass_client_no_auth

View File

@ -55,7 +55,7 @@ def validate_config(config):
class MockMediaPlayer(media_player.MediaPlayerEntity):
"""Mock media player for testing."""
def __init__(self, hass, name):
def __init__(self, hass: HomeAssistant, name: str) -> None:
"""Initialize the media player."""
self.hass = hass
self._name = name