mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Prevent opening of sockets in kira tests (#57038)
This commit is contained in:
parent
dc6f6b7f68
commit
80a225ca98
@ -1,9 +1,9 @@
|
|||||||
"""The tests for Home Assistant ffmpeg."""
|
"""The tests for Kira."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@ -33,13 +33,8 @@ KIRA_CODES = """
|
|||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def setup_comp():
|
def setup_comp():
|
||||||
"""Set up things to be run when tests are started."""
|
"""Set up things to be run when tests are started."""
|
||||||
_base_mock = MagicMock()
|
with patch("homeassistant.components.kira.pykira.KiraReceiver"):
|
||||||
pykira = _base_mock.pykira
|
yield
|
||||||
pykira.__file__ = "test"
|
|
||||||
_module_patcher = patch.dict("sys.modules", {"pykira": pykira})
|
|
||||||
_module_patcher.start()
|
|
||||||
yield
|
|
||||||
_module_patcher.stop()
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="module")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user