Use hass.config_entries.async_setup in mqtt test (#77750)

* Use hass.config_entries.async_setup

* The setup is awaited hence waiting is not needed
This commit is contained in:
Jan Bouwhuis 2022-09-03 15:44:50 +02:00 committed by GitHub
parent b0d033ef29
commit a3e6abd396
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1439,7 +1439,7 @@ async def test_unload_entry(hass, calls, device_reg, mqtt_mock, tmp_path) -> Non
new_yaml_config_file = tmp_path / "configuration.yaml"
new_yaml_config_file.write_text("")
with patch.object(hass_config, "YAML_CONFIG_FILE", new_yaml_config_file):
await mqtt_entry.async_setup(hass)
await hass.config_entries.async_setup(mqtt_entry.entry_id)
# Rediscover and fake short press 3
async_fire_mqtt_message(hass, "homeassistant/device_automation/bla1/config", data1)