diff --git a/tests/components/device_tracker/test_device_trigger.py b/tests/components/device_tracker/test_device_trigger.py index 8932eb15997..4236e316424 100644 --- a/tests/components/device_tracker/test_device_trigger.py +++ b/tests/components/device_tracker/test_device_trigger.py @@ -43,7 +43,7 @@ def calls(hass: HomeAssistant) -> list[ServiceCall]: @pytest.fixture(autouse=True) -def setup_zone(hass): +def setup_zone(hass: HomeAssistant) -> None: """Create test zone.""" hass.loop.run_until_complete( async_setup_component( diff --git a/tests/components/device_tracker/test_init.py b/tests/components/device_tracker/test_init.py index 6999a99f7ba..cedf2a2f0bc 100644 --- a/tests/components/device_tracker/test_init.py +++ b/tests/components/device_tracker/test_init.py @@ -8,6 +8,7 @@ from types import ModuleType from unittest.mock import call, patch import pytest +from typing_extensions import Generator from homeassistant.components import device_tracker, zone from homeassistant.components.device_tracker import SourceType, const, legacy @@ -49,7 +50,7 @@ _LOGGER = logging.getLogger(__name__) @pytest.fixture(name="yaml_devices") -def mock_yaml_devices(hass): +def mock_yaml_devices(hass: HomeAssistant) -> Generator[str]: """Get a path for storing yaml devices.""" yaml_devices = hass.config.path(legacy.YAML_DEVICES) if os.path.isfile(yaml_devices): @@ -108,7 +109,7 @@ async def test_reading_broken_yaml_config(hass: HomeAssistant) -> None: assert res[0].dev_id == "my_device" -async def test_reading_yaml_config(hass: HomeAssistant, yaml_devices) -> None: +async def test_reading_yaml_config(hass: HomeAssistant, yaml_devices: str) -> None: """Test the rendering of the YAML configuration.""" dev_id = "test" device = legacy.Device( @@ -186,7 +187,7 @@ async def test_duplicate_mac_dev_id(mock_warning, hass: HomeAssistant) -> None: assert "Duplicate device IDs" in args[0], "Duplicate device IDs warning expected" -async def test_setup_without_yaml_file(hass: HomeAssistant, yaml_devices) -> None: +async def test_setup_without_yaml_file(hass: HomeAssistant, yaml_devices: str) -> None: """Test with no YAML file.""" with assert_setup_component(1, device_tracker.DOMAIN): assert await async_setup_component(hass, device_tracker.DOMAIN, TEST_PLATFORM) @@ -487,7 +488,7 @@ async def test_invalid_dev_id( assert not devices -async def test_see_state(hass: HomeAssistant, yaml_devices) -> None: +async def test_see_state(hass: HomeAssistant, yaml_devices: str) -> None: """Test device tracker see records state correctly.""" assert await async_setup_component(hass, device_tracker.DOMAIN, TEST_PLATFORM) await hass.async_block_till_done()