Prevent opening of sockets in kira tests (#57038)

This commit is contained in:
Erik Montnemery 2021-10-04 13:33:29 +02:00 committed by GitHub
parent dc6f6b7f68
commit 80a225ca98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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