Skip to content

Commit

Permalink
Add more fixtures to pylint plugin (home-assistant#87685)
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet authored Feb 8, 2023
1 parent 380bfe5 commit a4c4f77
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions pylint/plugins/hass_enforce_type_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ class ClassTypeHintMatch:
]

_TEST_FIXTURES: dict[str, list[str] | str] = {
"aioclient_mock": "AiohttpClientMocker",
"aiohttp_client": "ClientSessionGenerator",
"caplog": "pytest.LogCaptureFixture",
"hass_client": "ClientSessionGenerator",
"hass_client_no_auth": "ClientSessionGenerator",
"hass_ws_client": "WebSocketGenerator",
"mqtt_client_mock": "MqttMockPahoClient",
"mqtt_mock": "MqttMockHAClient",
"mqtt_mock_entry_no_yaml_config": "MqttMockHAClientGenerator",
Expand Down
7 changes: 5 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@
init_recorder_component,
mock_storage,
)
from .test_util.aiohttp import mock_aiohttp_client # noqa: E402, isort:skip
from .test_util.aiohttp import ( # noqa: E402, isort:skip
AiohttpClientMocker,
mock_aiohttp_client,
)


_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -475,7 +478,7 @@ def requests_mock():


@pytest.fixture
def aioclient_mock():
def aioclient_mock() -> Generator[AiohttpClientMocker, None, None]:
"""Fixture to mock aioclient calls."""
with mock_aiohttp_client() as mock_session:
yield mock_session
Expand Down

0 comments on commit a4c4f77

Please sign in to comment.