Skip to content

Commit 58ac3d2

Browse files
authored
Type fixture in Fritz tests (home-assistant#163271)
1 parent 654e132 commit 58ac3d2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/components/fritz/conftest.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Common stuff for Fritz!Tools tests."""
22

3+
from collections.abc import Generator
34
import logging
45
from unittest.mock import MagicMock, patch
56

@@ -86,13 +87,13 @@ def _call_action(self, service: str, action: str, **kwargs):
8687

8788

8889
@pytest.fixture(name="fc_data")
89-
def fc_data_mock():
90+
def fc_data_mock() -> dict[str, dict]:
9091
"""Fixture for default fc_data."""
9192
return MOCK_FB_SERVICES
9293

9394

9495
@pytest.fixture
95-
def fc_class_mock(fc_data):
96+
def fc_class_mock(fc_data: dict[str, dict]) -> Generator[FritzConnectionMock]:
9697
"""Fixture that sets up a mocked FritzConnection class."""
9798
with patch(
9899
"homeassistant.components.fritz.coordinator.FritzConnectionCached",
@@ -103,7 +104,7 @@ def fc_class_mock(fc_data):
103104

104105

105106
@pytest.fixture
106-
def fh_class_mock():
107+
def fh_class_mock() -> Generator[type[FritzHosts]]:
107108
"""Fixture that sets up a mocked FritzHosts class."""
108109
with (
109110
patch(
@@ -125,7 +126,7 @@ def fh_class_mock():
125126

126127

127128
@pytest.fixture
128-
def fs_class_mock():
129+
def fs_class_mock() -> Generator[type[FritzStatus]]:
129130
"""Fixture that sets up a mocked FritzStatus class."""
130131
with (
131132
patch(

0 commit comments

Comments
 (0)