mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Speed up mqtt tests (#73423)
Co-authored-by: jbouwh <jan@jbsoft.nl> Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
This commit is contained in:
@@ -5,7 +5,7 @@ from unittest.mock import patch
|
||||
import pytest
|
||||
|
||||
from homeassistant.components import scene
|
||||
from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_ON, STATE_UNKNOWN
|
||||
from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_ON, STATE_UNKNOWN, Platform
|
||||
import homeassistant.core as ha
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
@@ -34,6 +34,13 @@ DEFAULT_CONFIG = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def scene_platform_only():
|
||||
"""Only setup the scene platform to speed up tests."""
|
||||
with patch("homeassistant.components.mqtt.PLATFORMS", [Platform.SCENE]):
|
||||
yield
|
||||
|
||||
|
||||
async def test_sending_mqtt_commands(hass, mqtt_mock_entry_with_yaml_config):
|
||||
"""Test the sending MQTT commands."""
|
||||
fake_state = ha.State("scene.test", STATE_UNKNOWN)
|
||||
|
||||
Reference in New Issue
Block a user