Add missing type hints to tests (#90218)

* Add type hints to tests

* Revert gree as handled in #90222
This commit is contained in:
epenet 2023-03-25 03:34:01 +01:00 committed by GitHub
parent 7f1fff12ef
commit 5f3868b141
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 13 deletions

View File

@ -668,7 +668,7 @@ async def test_trigger_timestamp_window_edge(
async def test_event_start_trigger_dst(
hass: HomeAssistant, calls, fake_schedule, freezer
hass: HomeAssistant, calls, fake_schedule, freezer: FrozenDateTimeFactory
) -> None:
"""Test a calendar event trigger happening at the start of daylight savings time."""
tzinfo = zoneinfo.ZoneInfo("America/Los_Angeles")

View File

@ -1,5 +1,4 @@
"""Tests for diagnostics platform of local calendar."""
from aiohttp.test_utils import TestClient
from freezegun import freeze_time
import pytest
@ -9,11 +8,11 @@ from homeassistant.auth.models import Credentials
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from .conftest import TEST_ENTITY, Client, ClientFixture
from .conftest import TEST_ENTITY, Client
from tests.common import CLIENT_ID, MockConfigEntry, MockUser
from tests.components.diagnostics import get_diagnostics_for_config_entry
from tests.typing import ClientSessionGenerator
from tests.typing import ClientSessionGenerator, WebSocketGenerator
async def generate_new_hass_access_token(
@ -82,7 +81,7 @@ async def test_api_date_time_event(
hass_admin_user: MockUser,
hass_admin_credential: Credentials,
config_entry: MockConfigEntry,
hass_ws_client: ClientFixture,
hass_ws_client: WebSocketGenerator,
aiohttp_client: ClientSessionGenerator,
socket_enabled: None,
snapshot: SnapshotAssertion,

View File

@ -7,6 +7,7 @@ import zigpy.state
from homeassistant.components import zha
from homeassistant.components.zha import api
from homeassistant.components.zha.core.const import RadioType
from homeassistant.core import HomeAssistant
@pytest.fixture(autouse=True)
@ -16,7 +17,9 @@ def required_platform_only():
yield
async def test_async_get_network_settings_active(hass, setup_zha):
async def test_async_get_network_settings_active(
hass: HomeAssistant, setup_zha
) -> None:
"""Test reading settings with an active ZHA installation."""
await setup_zha()
@ -25,8 +28,8 @@ async def test_async_get_network_settings_active(hass, setup_zha):
async def test_async_get_network_settings_inactive(
hass, setup_zha, zigpy_app_controller
):
hass: HomeAssistant, setup_zha, zigpy_app_controller
) -> None:
"""Test reading settings with an inactive ZHA installation."""
await setup_zha()
@ -48,8 +51,8 @@ async def test_async_get_network_settings_inactive(
async def test_async_get_network_settings_missing(
hass, setup_zha, zigpy_app_controller
):
hass: HomeAssistant, setup_zha, zigpy_app_controller
) -> None:
"""Test reading settings with an inactive ZHA installation, no valid channel."""
await setup_zha()
@ -69,13 +72,13 @@ async def test_async_get_network_settings_missing(
assert settings is None
async def test_async_get_network_settings_failure(hass):
async def test_async_get_network_settings_failure(hass: HomeAssistant) -> None:
"""Test reading settings with no ZHA config entries and no database."""
with pytest.raises(ValueError):
await api.async_get_network_settings(hass)
async def test_async_get_radio_type_active(hass, setup_zha):
async def test_async_get_radio_type_active(hass: HomeAssistant, setup_zha) -> None:
"""Test reading the radio type with an active ZHA installation."""
await setup_zha()
@ -83,7 +86,7 @@ async def test_async_get_radio_type_active(hass, setup_zha):
assert radio_type == RadioType.ezsp
async def test_async_get_radio_path_active(hass, setup_zha):
async def test_async_get_radio_path_active(hass: HomeAssistant, setup_zha) -> None:
"""Test reading the radio path with an active ZHA installation."""
await setup_zha()