Add more fixtures to pylint plugin (#87685)

This commit is contained in:
epenet 2023-02-08 10:51:09 +01:00 committed by GitHub
parent 380bfe5b28
commit a4c4f77f73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -91,7 +91,12 @@ _METHOD_MATCH: list[TypeHintMatch] = [
]
_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",

View File

@ -77,7 +77,10 @@ from .common import ( # noqa: E402, isort:skip
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__)
@ -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