Add type hints to matrix events fixtures (#121213)

This commit is contained in:
epenet 2024-07-04 16:17:18 +02:00 committed by GitHub
parent d12f2384c5
commit 9a1f7f020c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -48,7 +48,7 @@ from homeassistant.const import (
CONF_USERNAME,
CONF_VERIFY_SSL,
)
from homeassistant.core import HomeAssistant
from homeassistant.core import Event, HomeAssistant
from homeassistant.setup import async_setup_component
from tests.common import async_capture_events
@ -294,13 +294,13 @@ async def matrix_bot(
@pytest.fixture
def matrix_events(hass: HomeAssistant):
def matrix_events(hass: HomeAssistant) -> list[Event]:
"""Track event calls."""
return async_capture_events(hass, MATRIX_DOMAIN)
@pytest.fixture
def command_events(hass: HomeAssistant):
def command_events(hass: HomeAssistant) -> list[Event]:
"""Track event calls."""
return async_capture_events(hass, EVENT_MATRIX_COMMAND)

View File

@ -10,7 +10,7 @@ from homeassistant.components.matrix import (
)
from homeassistant.components.matrix.const import FORMAT_HTML, SERVICE_SEND_MESSAGE
from homeassistant.components.notify import ATTR_DATA, ATTR_MESSAGE, ATTR_TARGET
from homeassistant.core import HomeAssistant
from homeassistant.core import Event, HomeAssistant
from .conftest import TEST_BAD_ROOM, TEST_JOINABLE_ROOMS
@ -19,7 +19,7 @@ async def test_send_message(
hass: HomeAssistant,
matrix_bot: MatrixBot,
image_path,
matrix_events,
matrix_events: list[Event],
caplog: pytest.LogCaptureFixture,
) -> None:
"""Test the send_message service."""
@ -63,7 +63,7 @@ async def test_send_message(
async def test_unsendable_message(
hass: HomeAssistant,
matrix_bot: MatrixBot,
matrix_events,
matrix_events: list[Event],
caplog: pytest.LogCaptureFixture,
) -> None:
"""Test the send_message service with an invalid room."""