diff --git a/tests/components/onboarding/test_views.py b/tests/components/onboarding/test_views.py index 556b590e746..3b60178b6ec 100644 --- a/tests/components/onboarding/test_views.py +++ b/tests/components/onboarding/test_views.py @@ -192,10 +192,9 @@ async def test_onboarding_user( hass: HomeAssistant, hass_storage: dict[str, Any], hass_client_no_auth: ClientSessionGenerator, + area_registry: ar.AreaRegistry, ) -> None: """Test creating a new user.""" - area_registry = ar.async_get(hass) - # Create an existing area to mimic an integration creating an area # before onboarding is done. area_registry.async_create("Living Room") diff --git a/tests/components/zwave_js/test_helpers.py b/tests/components/zwave_js/test_helpers.py index 38e15df52cc..7696106ec18 100644 --- a/tests/components/zwave_js/test_helpers.py +++ b/tests/components/zwave_js/test_helpers.py @@ -25,10 +25,11 @@ async def test_async_get_node_status_sensor_entity_id(hass: HomeAssistant) -> No assert async_get_node_status_sensor_entity_id(hass, device.id) is None -async def test_async_get_nodes_from_area_id(hass: HomeAssistant) -> None: +async def test_async_get_nodes_from_area_id( + hass: HomeAssistant, area_registry: ar.AreaRegistry +) -> None: """Test async_get_nodes_from_area_id.""" - area_reg = ar.async_get(hass) - area = area_reg.async_create("test") + area = area_registry.async_create("test") assert not async_get_nodes_from_area_id(hass, area.id) diff --git a/tests/components/zwave_js/test_init.py b/tests/components/zwave_js/test_init.py index 15e3e89312e..0f6f8b71c65 100644 --- a/tests/components/zwave_js/test_init.py +++ b/tests/components/zwave_js/test_init.py @@ -353,6 +353,7 @@ async def test_existing_node_not_replaced_when_not_ready( zp3111_state, client, integration, + area_registry: ar.AreaRegistry, ) -> None: """Test when a node added event with a non-ready node is received. @@ -360,7 +361,7 @@ async def test_existing_node_not_replaced_when_not_ready( """ dev_reg = dr.async_get(hass) er_reg = er.async_get(hass) - kitchen_area = ar.async_get(hass).async_create("Kitchen") + kitchen_area = area_registry.async_create("Kitchen") device_id = f"{client.driver.controller.home_id}-{zp3111.node_id}" device_id_ext = (