diff --git a/tests/components/broadlink/test_device.py b/tests/components/broadlink/test_device.py index 5430af9e311..4ebfead007b 100644 --- a/tests/components/broadlink/test_device.py +++ b/tests/components/broadlink/test_device.py @@ -2,6 +2,7 @@ from unittest.mock import patch import broadlink.exceptions as blke +import pytest from homeassistant.components.broadlink.const import DOMAIN from homeassistant.components.broadlink.device import get_domains @@ -15,6 +16,13 @@ from tests.common import mock_device_registry, mock_registry DEVICE_FACTORY = "homeassistant.components.broadlink.device.blk.gendevice" +@pytest.fixture(autouse=True) +def mock_heartbeat(): + """Mock broadlink heartbeat.""" + with patch("homeassistant.components.broadlink.heartbeat.blk.ping"): + yield + + async def test_device_setup(hass): """Test a successful setup.""" device = get_device("Office") diff --git a/tests/components/broadlink/test_heartbeat.py b/tests/components/broadlink/test_heartbeat.py index de47a16c0b9..5065bded881 100644 --- a/tests/components/broadlink/test_heartbeat.py +++ b/tests/components/broadlink/test_heartbeat.py @@ -1,6 +1,8 @@ """Tests for Broadlink heartbeats.""" from unittest.mock import call, patch +import pytest + from homeassistant.components.broadlink.heartbeat import BroadlinkHeartbeat from homeassistant.util import dt @@ -11,6 +13,13 @@ from tests.common import async_fire_time_changed DEVICE_PING = "homeassistant.components.broadlink.heartbeat.blk.ping" +@pytest.fixture(autouse=True) +def mock_heartbeat(): + """Mock broadlink heartbeat.""" + with patch("homeassistant.components.broadlink.heartbeat.blk.ping"): + yield + + async def test_heartbeat_trigger_startup(hass): """Test that the heartbeat is initialized with the first config entry.""" device = get_device("Office")