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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 347 additions and 4 deletions

View file

@ -37,7 +37,7 @@ from homeassistant.components.zha.core.const import (
GROUP_IDS,
GROUP_NAME,
)
from homeassistant.const import ATTR_NAME
from homeassistant.const import ATTR_NAME, Platform
from homeassistant.core import Context
from .conftest import (
@ -53,6 +53,20 @@ IEEE_SWITCH_DEVICE = "01:2d:6f:00:0a:90:69:e7"
IEEE_GROUPABLE_DEVICE = "01:2d:6f:00:0a:90:69:e8"
@pytest.fixture(autouse=True)
def required_platform_only():
"""Only setup the required and required base platforms to speed up tests."""
with patch(
"homeassistant.components.zha.PLATFORMS",
(
Platform.SELECT,
Platform.SENSOR,
Platform.SWITCH,
),
):
yield
@pytest.fixture
async def device_switch(hass, zigpy_device_mock, zha_device_joined):
"""Test zha switch platform."""