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:
parent
034c0c0593
commit
51b4d15c8c
29 changed files with 281 additions and 10 deletions
|
@ -1,5 +1,7 @@
|
|||
"""The tests for the MQTT subscription component."""
|
||||
from unittest.mock import ANY
|
||||
from unittest.mock import ANY, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.mqtt.subscription import (
|
||||
async_prepare_subscribe_topics,
|
||||
|
@ -11,6 +13,13 @@ from homeassistant.core import callback
|
|||
from tests.common import async_fire_mqtt_message
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def no_platforms():
|
||||
"""Skip platform setup to speed up tests."""
|
||||
with patch("homeassistant.components.mqtt.PLATFORMS", []):
|
||||
yield
|
||||
|
||||
|
||||
async def test_subscribe_topics(hass, mqtt_mock_entry_no_yaml_config, caplog):
|
||||
"""Test subscription to topics."""
|
||||
await mqtt_mock_entry_no_yaml_config()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue