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:
J. Nick Koston 2022-06-13 10:17:10 -10:00 committed by GitHub
parent 034c0c0593
commit 51b4d15c8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 281 additions and 10 deletions

View file

@ -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()