From ef6c7621cfbe88789259570a2de24521bad0180f Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 28 May 2024 14:20:01 +0200 Subject: [PATCH] Use registry fixtures in scaffold (#118308) --- .../templates/config_flow_helper/tests/test_init.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/scaffold/templates/config_flow_helper/tests/test_init.py b/script/scaffold/templates/config_flow_helper/tests/test_init.py index 73ac28da059..3c1a3395b86 100644 --- a/script/scaffold/templates/config_flow_helper/tests/test_init.py +++ b/script/scaffold/templates/config_flow_helper/tests/test_init.py @@ -12,11 +12,11 @@ from tests.common import MockConfigEntry @pytest.mark.parametrize("platform", ["sensor"]) async def test_setup_and_remove_config_entry( hass: HomeAssistant, + entity_registry: er.EntityRegistry, platform: str, ) -> None: """Test setting up and removing a config entry.""" input_sensor_entity_id = "sensor.input" - registry = er.async_get(hass) NEW_DOMAIN_entity_id = f"{platform}.my_NEW_DOMAIN" # Setup the config entry @@ -34,7 +34,7 @@ async def test_setup_and_remove_config_entry( await hass.async_block_till_done() # Check the entity is registered in the entity registry - assert registry.async_get(NEW_DOMAIN_entity_id) is not None + assert entity_registry.async_get(NEW_DOMAIN_entity_id) is not None # Check the platform is setup correctly state = hass.states.get(NEW_DOMAIN_entity_id) @@ -48,4 +48,4 @@ async def test_setup_and_remove_config_entry( # Check the state and entity registry entry are removed assert hass.states.get(NEW_DOMAIN_entity_id) is None - assert registry.async_get(NEW_DOMAIN_entity_id) is None + assert entity_registry.async_get(NEW_DOMAIN_entity_id) is None