Fix lingering reload task in notion reauth (#88949)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
J. Nick Koston 2023-03-01 02:07:46 -06:00 committed by GitHub
parent 9ab95b6348
commit 202bed5d51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -109,6 +109,11 @@ async def test_reauth(
result = await hass.config_entries.flow.async_configure( result = await hass.config_entries.flow.async_configure(
result["flow_id"], user_input={CONF_PASSWORD: "password"} result["flow_id"], user_input={CONF_PASSWORD: "password"}
) )
# Block to ensure the setup_config_entry fixture does not
# get undone before hass is shutdown so we do not try
# to setup the config entry via reload.
await hass.async_block_till_done()
assert result["type"] == data_entry_flow.FlowResultType.ABORT assert result["type"] == data_entry_flow.FlowResultType.ABORT
assert result["reason"] == "reauth_successful" assert result["reason"] == "reauth_successful"
assert len(hass.config_entries.async_entries()) == 1 assert len(hass.config_entries.async_entries()) == 1