1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Add type hints to integration tests (j-m) (#87704)

This commit is contained in:
epenet
2023-02-08 19:06:59 +01:00
committed by GitHub
parent 630028106a
commit f75ac17554
103 changed files with 605 additions and 417 deletions

View File

@@ -3,8 +3,11 @@ from collections import defaultdict
import logging
from unittest.mock import Mock, patch
import pytest
from homeassistant.components import logger
from homeassistant.components.logger import LOGSEVERITY
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
HASS_NS = "unused.homeassistant"
@@ -17,7 +20,9 @@ INTEGRATION = "test_component"
INTEGRATION_NS = f"homeassistant.components.{INTEGRATION}"
async def test_log_filtering(hass, caplog):
async def test_log_filtering(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
) -> None:
"""Test logging filters."""
assert await async_setup_component(
@@ -85,7 +90,7 @@ async def test_log_filtering(hass, caplog):
)
async def test_setting_level(hass):
async def test_setting_level(hass: HomeAssistant) -> None:
"""Test we set log levels."""
mocks = defaultdict(Mock)
@@ -150,7 +155,7 @@ async def test_setting_level(hass):
)
async def test_can_set_level_from_yaml(hass):
async def test_can_set_level_from_yaml(hass: HomeAssistant) -> None:
"""Test logger propagation."""
assert await async_setup_component(