mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Speed up zha tests (#73627)
This commit is contained in:
@@ -12,7 +12,7 @@ from homeassistant.components.zha.core.const import (
|
||||
CONF_DEFAULT_CONSIDER_UNAVAILABLE_BATTERY,
|
||||
CONF_DEFAULT_CONSIDER_UNAVAILABLE_MAINS,
|
||||
)
|
||||
from homeassistant.const import STATE_OFF, STATE_UNAVAILABLE
|
||||
from homeassistant.const import STATE_OFF, STATE_UNAVAILABLE, Platform
|
||||
import homeassistant.helpers.device_registry as dr
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
@@ -22,6 +22,22 @@ from .conftest import SIG_EP_INPUT, SIG_EP_OUTPUT, SIG_EP_TYPE
|
||||
from tests.common import async_fire_time_changed
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def required_platforms_only():
|
||||
"""Only setup the required platform and required base platforms to speed up tests."""
|
||||
with patch(
|
||||
"homeassistant.components.zha.PLATFORMS",
|
||||
(
|
||||
Platform.DEVICE_TRACKER,
|
||||
Platform.SENSOR,
|
||||
Platform.SELECT,
|
||||
Platform.SWITCH,
|
||||
Platform.BINARY_SENSOR,
|
||||
),
|
||||
):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def zigpy_device(zigpy_device_mock):
|
||||
"""Device tracker zigpy device."""
|
||||
|
||||
Reference in New Issue
Block a user