mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Add more fixtures to pylint plugin (#87685)
This commit is contained in:
parent
380bfe5b28
commit
a4c4f77f73
@ -91,7 +91,12 @@ _METHOD_MATCH: list[TypeHintMatch] = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
_TEST_FIXTURES: dict[str, list[str] | str] = {
|
_TEST_FIXTURES: dict[str, list[str] | str] = {
|
||||||
|
"aioclient_mock": "AiohttpClientMocker",
|
||||||
|
"aiohttp_client": "ClientSessionGenerator",
|
||||||
"caplog": "pytest.LogCaptureFixture",
|
"caplog": "pytest.LogCaptureFixture",
|
||||||
|
"hass_client": "ClientSessionGenerator",
|
||||||
|
"hass_client_no_auth": "ClientSessionGenerator",
|
||||||
|
"hass_ws_client": "WebSocketGenerator",
|
||||||
"mqtt_client_mock": "MqttMockPahoClient",
|
"mqtt_client_mock": "MqttMockPahoClient",
|
||||||
"mqtt_mock": "MqttMockHAClient",
|
"mqtt_mock": "MqttMockHAClient",
|
||||||
"mqtt_mock_entry_no_yaml_config": "MqttMockHAClientGenerator",
|
"mqtt_mock_entry_no_yaml_config": "MqttMockHAClientGenerator",
|
||||||
|
@ -77,7 +77,10 @@ from .common import ( # noqa: E402, isort:skip
|
|||||||
init_recorder_component,
|
init_recorder_component,
|
||||||
mock_storage,
|
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__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
@ -475,7 +478,7 @@ def requests_mock():
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def aioclient_mock():
|
def aioclient_mock() -> Generator[AiohttpClientMocker, None, None]:
|
||||||
"""Fixture to mock aioclient calls."""
|
"""Fixture to mock aioclient calls."""
|
||||||
with mock_aiohttp_client() as mock_session:
|
with mock_aiohttp_client() as mock_session:
|
||||||
yield mock_session
|
yield mock_session
|
||||||
|
Loading…
x
Reference in New Issue
Block a user