Files
core/tests/components/demo/conftest.py
2026-01-20 15:46:06 +01:00

33 lines
835 B
Python

"""demo conftest."""
from unittest.mock import patch
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from tests.components.light.conftest import mock_light_profiles # noqa: F401
@pytest.fixture(autouse=True)
async def setup_homeassistant(hass: HomeAssistant):
"""Set up the homeassistant integration."""
await async_setup_component(hass, "homeassistant", {})
@pytest.fixture
def disable_platforms(hass: HomeAssistant) -> None:
"""Disable platforms to speed up tests."""
with (
patch(
"homeassistant.components.demo.COMPONENTS_WITH_CONFIG_ENTRY_DEMO_PLATFORM",
[],
),
patch(
"homeassistant.components.demo.COMPONENTS_WITH_DEMO_PLATFORM",
[],
),
):
yield