diff --git a/tests/components/honeywell/test_init.py b/tests/components/honeywell/test_init.py index cdd767f019d..ac24876413d 100644 --- a/tests/components/honeywell/test_init.py +++ b/tests/components/honeywell/test_init.py @@ -173,14 +173,13 @@ async def test_remove_stale_device( identifiers={("OtherDomain", 7654321)}, ) + config_entry.add_to_hass(hass) device_registry.async_update_device( device_entry_other.id, add_config_entry_id=config_entry.entry_id, merge_identifiers={(DOMAIN, 7654321)}, ) - config_entry.add_to_hass(hass) - await hass.config_entries.async_setup(config_entry.entry_id) await hass.async_block_till_done() assert config_entry.state is ConfigEntryState.LOADED diff --git a/tests/components/switch_as_x/test_init.py b/tests/components/switch_as_x/test_init.py index 3889a43f741..e250cacb7ac 100644 --- a/tests/components/switch_as_x/test_init.py +++ b/tests/components/switch_as_x/test_init.py @@ -171,8 +171,10 @@ async def test_device_registry_config_entry_1( original_name="ABC", ) # Add another config entry to the same device + other_config_entry = MockConfigEntry() + other_config_entry.add_to_hass(hass) device_registry.async_update_device( - device_entry.id, add_config_entry_id=MockConfigEntry().entry_id + device_entry.id, add_config_entry_id=other_config_entry.entry_id ) switch_as_x_config_entry = MockConfigEntry(