diff --git a/tests/components/nmbs/test_init.py b/tests/components/nmbs/test_init.py index f08334fcc8ea..ea42510fecf6 100644 --- a/tests/components/nmbs/test_init.py +++ b/tests/components/nmbs/test_init.py @@ -15,7 +15,6 @@ from homeassistant.components.nmbs.const import ( ) from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant -from homeassistant.setup import async_setup_component async def test_setup_entry( @@ -158,7 +157,10 @@ async def test_concurrent_setup_shares_station_fetch( mock_config_entry.add_to_hass(hass) mock_second_config_entry.add_to_hass(hass) - setup_task = hass.async_create_task(async_setup_component(hass, DOMAIN, {})) + # Setting up one entry sets up the integration, which sets up both entries. + setup_task = hass.async_create_task( + hass.config_entries.async_setup(mock_config_entry.entry_id) + ) # Release the fetch only after both entry setups are underway, so the # second entry sees the first entry's fetch in flight rather than a # completed task.