From 80a225ca98606f0713160874067891c435e6b392 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Mon, 4 Oct 2021 13:33:29 +0200 Subject: [PATCH] Prevent opening of sockets in kira tests (#57038) --- tests/components/kira/test_init.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/components/kira/test_init.py b/tests/components/kira/test_init.py index 93f3ee4d82a..3ca7a72a60a 100644 --- a/tests/components/kira/test_init.py +++ b/tests/components/kira/test_init.py @@ -1,9 +1,9 @@ -"""The tests for Home Assistant ffmpeg.""" +"""The tests for Kira.""" import os import shutil import tempfile -from unittest.mock import MagicMock, patch +from unittest.mock import patch import pytest @@ -33,13 +33,8 @@ KIRA_CODES = """ @pytest.fixture(autouse=True) def setup_comp(): """Set up things to be run when tests are started.""" - _base_mock = MagicMock() - pykira = _base_mock.pykira - pykira.__file__ = "test" - _module_patcher = patch.dict("sys.modules", {"pykira": pykira}) - _module_patcher.start() - yield - _module_patcher.stop() + with patch("homeassistant.components.kira.pykira.KiraReceiver"): + yield @pytest.fixture(scope="module")