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