diff --git a/packages/pytest-home-assistant/pytest_homeassistant/plugins.py b/packages/pytest-home-assistant/pytest_homeassistant/plugins.py index 45fa0f4d4798..79e3b4880762 100644 --- a/packages/pytest-home-assistant/pytest_homeassistant/plugins.py +++ b/packages/pytest-home-assistant/pytest_homeassistant/plugins.py @@ -133,6 +133,7 @@ if TYPE_CHECKING: MockInfraredEmitterEntity, MockInfraredReceiverEntity, ) + from .components.radio_frequency.common import MockRadioFrequencyEntity pytest.register_assert_rewrite("pytest_homeassistant.common") @@ -2046,6 +2047,24 @@ def mock_recorder_before_hass() -> None: """ +@pytest.fixture(name="init_radio_frequency") +async def init_radio_frequency_fixture(hass: HomeAssistant) -> None: + """Set up the Radio Frequency integration for testing.""" + from .components.radio_frequency.common import init_radio_frequency_fixture_helper # noqa: PLC0415 + + await init_radio_frequency_fixture_helper(hass) + + +@pytest.fixture(name="mock_rf_entity") +async def mock_rf_entity_fixture( + hass: HomeAssistant, init_radio_frequency: None +) -> MockRadioFrequencyEntity: + """Return a mock radio frequency entity.""" + from .components.radio_frequency.common import mock_rf_entity_fixture_helper # noqa: PLC0415 + + return await mock_rf_entity_fixture_helper(hass) + + @pytest.fixture(name="init_infrared") async def init_infrared_fixture(hass: HomeAssistant) -> None: """Set up the Infrared integration for testing.""" diff --git a/tests/components/bluetooth/__init__.py b/tests/components/bluetooth/__init__.py index fb7e1b338c50..4c91c5085bab 100644 --- a/tests/components/bluetooth/__init__.py +++ b/tests/components/bluetooth/__init__.py @@ -1,4 +1,4 @@ -"""Compatibility imports for the Home Assistant pytest helpers.""" +"""Tests for the Bluetooth integration.""" from pytest_homeassistant.components.bluetooth import ( ADVERTISEMENT_DATA_DEFAULTS as ADVERTISEMENT_DATA_DEFAULTS, diff --git a/tests/components/conftest.py b/tests/components/conftest.py index 3a63031bbbe8..e7cda2dc2752 100644 --- a/tests/components/conftest.py +++ b/tests/components/conftest.py @@ -58,8 +58,10 @@ import probatio import pytest from pytest_homeassistant.plugins import ( init_infrared_fixture as init_infrared_fixture, + init_radio_frequency_fixture as init_radio_frequency_fixture, mock_infrared_emitter_entity_fixture as mock_infrared_emitter_entity_fixture, mock_infrared_receiver_entity_fixture as mock_infrared_receiver_entity_fixture, + mock_rf_entity_fixture as mock_rf_entity_fixture, ) from homeassistant import components, loader @@ -104,7 +106,6 @@ if TYPE_CHECKING: from .conversation import MockAgent from .device_tracker.common import MockScanner from .light.common import MockLight - from .radio_frequency.common import MockRadioFrequencyEntity from .sensor.common import MockSensor from .switch.common import MockSwitch @@ -207,25 +208,6 @@ def mock_conversation_agent_fixture(hass: HomeAssistant) -> MockAgent: return mock_conversation_agent_fixture_helper(hass) -# Radio frequency test fixtures -@pytest.fixture(name="init_radio_frequency") -async def init_radio_frequency_fixture(hass: HomeAssistant) -> None: - """Set up the Radio Frequency integration for testing.""" - from .radio_frequency.common import init_radio_frequency_fixture_helper # noqa: PLC0415 - - await init_radio_frequency_fixture_helper(hass) - - -@pytest.fixture(name="mock_rf_entity") -async def mock_rf_entity_fixture( - hass: HomeAssistant, init_radio_frequency: None -) -> MockRadioFrequencyEntity: - """Return a mock radio frequency entity.""" - from .radio_frequency.common import mock_rf_entity_fixture_helper # noqa: PLC0415 - - return await mock_rf_entity_fixture_helper(hass) - - @pytest.fixture(scope="session", autouse=find_spec("haffmpeg") is not None) def prevent_ffmpeg_subprocess() -> Generator[None]: """If installed, prevent ffmpeg from creating a subprocess.""" diff --git a/tests/components/infrared/__init__.py b/tests/components/infrared/__init__.py index fddc1aed537d..a0ba750aeb22 100644 --- a/tests/components/infrared/__init__.py +++ b/tests/components/infrared/__init__.py @@ -1,4 +1,4 @@ -"""Compatibility imports for the Home Assistant pytest helpers.""" +"""Tests for the infrared integration.""" from pytest_homeassistant.components.infrared import ( EMITTER_ENTITY_ID as EMITTER_ENTITY_ID, diff --git a/tests/components/radio_frequency/__init__.py b/tests/components/radio_frequency/__init__.py index 23d10a324c2a..137e625f960b 100644 --- a/tests/components/radio_frequency/__init__.py +++ b/tests/components/radio_frequency/__init__.py @@ -1,3 +1,3 @@ -"""Compatibility imports for the Home Assistant pytest helpers.""" +"""Tests for the radio frequency integration.""" from pytest_homeassistant.components.radio_frequency import ENTITY_ID as ENTITY_ID