Add caplog to known fixtures in pylint plugin (#87617)

This commit is contained in:
epenet 2023-02-07 11:34:02 +01:00 committed by GitHub
parent c78cae4483
commit ef6798e854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -91,6 +91,7 @@ _METHOD_MATCH: list[TypeHintMatch] = [
] ]
_TEST_FIXTURES: dict[str, list[str] | str] = { _TEST_FIXTURES: dict[str, list[str] | str] = {
"caplog": "pytest.LogCaptureFixture",
"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",

View File

@ -114,7 +114,7 @@ async def test_field_types(
assert hass.states.get(f"sensor.test_{entity_id}").state == expected assert hass.states.get(f"sensor.test_{entity_id}").state == expected
async def test_no_field(hass: HomeAssistant, caplog: Any) -> None: async def test_no_field(hass: HomeAssistant, caplog: pytest.LogCaptureFixture) -> None:
"""Test behavior when the expected field is not present.""" """Test behavior when the expected field is not present."""
config_entry = MockConfigEntry(domain=DOMAIN, data=MOCK_ENTRY_DATA) config_entry = MockConfigEntry(domain=DOMAIN, data=MOCK_ENTRY_DATA)
config_entry.add_to_hass(hass) config_entry.add_to_hass(hass)

View File

@ -1,7 +1,6 @@
"""Test the motionEye camera web hooks.""" """Test the motionEye camera web hooks."""
import copy import copy
from http import HTTPStatus from http import HTTPStatus
from typing import Any
from unittest.mock import AsyncMock, Mock, call, patch from unittest.mock import AsyncMock, Mock, call, patch
from motioneye_client.const import ( from motioneye_client.const import (
@ -15,6 +14,7 @@ from motioneye_client.const import (
KEY_WEB_HOOK_STORAGE_HTTP_METHOD, KEY_WEB_HOOK_STORAGE_HTTP_METHOD,
KEY_WEB_HOOK_STORAGE_URL, KEY_WEB_HOOK_STORAGE_URL,
) )
import pytest
from homeassistant.components.motioneye.const import ( from homeassistant.components.motioneye.const import (
ATTR_EVENT_TYPE, ATTR_EVENT_TYPE,
@ -250,8 +250,7 @@ async def test_setup_camera_with_correct_webhook(
async def test_setup_camera_with_no_home_assistant_urls( async def test_setup_camera_with_no_home_assistant_urls(
hass: HomeAssistant, hass: HomeAssistant, caplog: pytest.LogCaptureFixture
caplog: Any,
) -> None: ) -> None:
"""Verify setup works without Home Assistant internal/external URLs.""" """Verify setup works without Home Assistant internal/external URLs."""