Skip to content

Commit

Permalink
Address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery committed May 2, 2024
1 parent 64e1b17 commit 0693722
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/components/recorder/test_entity_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
)

from tests.common import MockEntity, MockEntityPlatform
from tests.typing import RecorderInstanceGenerator


def _count_entity_id_in_states_meta(
Expand All @@ -38,8 +37,13 @@ def _count_entity_id_in_states_meta(
)


@pytest.fixture(autouse=True)
def enable_recorder(recorder_mock: Recorder) -> recorder.Recorder:
"""Set up recorder."""
return recorder_mock


async def test_rename_entity_without_collision(
recorder_mock: Recorder,
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
caplog: pytest.LogCaptureFixture,
Expand Down Expand Up @@ -91,7 +95,6 @@ async def test_rename_entity_without_collision(


async def test_rename_entity_on_mocked_platform(
async_setup_recorder_instance: RecorderInstanceGenerator,
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
caplog: pytest.LogCaptureFixture,
Expand All @@ -102,7 +105,7 @@ async def test_rename_entity_on_mocked_platform(
sure that we do not record the entity as removed in the database
when we rename it.
"""
instance = await async_setup_recorder_instance(hass)
instance = recorder.get_instance(hass)
start = dt_util.utcnow()

reg_entry = entity_registry.async_get_or_create(
Expand Down Expand Up @@ -187,7 +190,6 @@ def _get_states_meta_counts():


async def test_rename_entity_collision(
recorder_mock: Recorder,
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
caplog: pytest.LogCaptureFixture,
Expand Down Expand Up @@ -253,7 +255,6 @@ async def test_rename_entity_collision(


async def test_rename_entity_collision_without_states_meta_safeguard(
recorder_mock: Recorder,
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
caplog: pytest.LogCaptureFixture,
Expand Down

0 comments on commit 0693722

Please sign in to comment.