From ef6798e854f307058d56aec930716f54df3b71db Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 7 Feb 2023 11:34:02 +0100 Subject: [PATCH] Add caplog to known fixtures in pylint plugin (#87617) --- pylint/plugins/hass_enforce_type_hints.py | 1 + tests/components/lacrosse_view/test_sensor.py | 2 +- tests/components/motioneye/test_web_hooks.py | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pylint/plugins/hass_enforce_type_hints.py b/pylint/plugins/hass_enforce_type_hints.py index c489a508798..d2355d0b4d2 100644 --- a/pylint/plugins/hass_enforce_type_hints.py +++ b/pylint/plugins/hass_enforce_type_hints.py @@ -91,6 +91,7 @@ _METHOD_MATCH: list[TypeHintMatch] = [ ] _TEST_FIXTURES: dict[str, list[str] | str] = { + "caplog": "pytest.LogCaptureFixture", "mqtt_client_mock": "MqttMockPahoClient", "mqtt_mock": "MqttMockHAClient", "mqtt_mock_entry_no_yaml_config": "MqttMockHAClientGenerator", diff --git a/tests/components/lacrosse_view/test_sensor.py b/tests/components/lacrosse_view/test_sensor.py index b39ce7acc86..b87787ab1b3 100644 --- a/tests/components/lacrosse_view/test_sensor.py +++ b/tests/components/lacrosse_view/test_sensor.py @@ -114,7 +114,7 @@ async def test_field_types( 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.""" config_entry = MockConfigEntry(domain=DOMAIN, data=MOCK_ENTRY_DATA) config_entry.add_to_hass(hass) diff --git a/tests/components/motioneye/test_web_hooks.py b/tests/components/motioneye/test_web_hooks.py index 848f078da40..a55f71b1d60 100644 --- a/tests/components/motioneye/test_web_hooks.py +++ b/tests/components/motioneye/test_web_hooks.py @@ -1,7 +1,6 @@ """Test the motionEye camera web hooks.""" import copy from http import HTTPStatus -from typing import Any from unittest.mock import AsyncMock, Mock, call, patch from motioneye_client.const import ( @@ -15,6 +14,7 @@ from motioneye_client.const import ( KEY_WEB_HOOK_STORAGE_HTTP_METHOD, KEY_WEB_HOOK_STORAGE_URL, ) +import pytest from homeassistant.components.motioneye.const import ( 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( - hass: HomeAssistant, - caplog: Any, + hass: HomeAssistant, caplog: pytest.LogCaptureFixture ) -> None: """Verify setup works without Home Assistant internal/external URLs."""