1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 04:50:05 +00:00

Convert test fixtures to async (#142052)

This commit is contained in:
Erik Montnemery
2025-04-02 14:05:07 +02:00
committed by GitHub
parent 93162f6b65
commit dfd86d56ec
24 changed files with 157 additions and 193 deletions

View File

@@ -22,12 +22,12 @@ from tests.typing import ClientSessionGenerator
@pytest.fixture
def mock_api_client(
async def mock_api_client(
hass: HomeAssistant, hass_client: ClientSessionGenerator
) -> TestClient:
"""Start the Home Assistant HTTP component and return admin API client."""
hass.loop.run_until_complete(async_setup_component(hass, "api", {}))
return hass.loop.run_until_complete(hass_client())
await async_setup_component(hass, "api", {})
return await hass_client()
async def test_api_list_state_entities(