Fix memory leaks in websocket api (#94780)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
J. Nick Koston 2023-06-19 18:27:22 -05:00 committed by GitHub
parent a7d327afa2
commit 1206f2c1da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 244 additions and 84 deletions

View file

@ -3,11 +3,19 @@ import pytest
from homeassistant.components.websocket_api.auth import TYPE_AUTH_REQUIRED
from homeassistant.components.websocket_api.http import URL
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from tests.typing import (
MockHAClientWebSocket,
WebSocketGenerator,
)
@pytest.fixture
async def websocket_client(hass, hass_ws_client):
async def websocket_client(
hass: HomeAssistant, hass_ws_client: WebSocketGenerator
) -> MockHAClientWebSocket:
"""Create a websocket client."""
return await hass_ws_client(hass)