1
0
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:
J. Nick Koston
2022-06-17 11:41:10 -05:00
committed by GitHub
parent bf15df75dd
commit 4bc5d7bfed
24 changed files with 347 additions and 4 deletions

View File

@@ -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."""