From 255ffe801bfa2a31f0088e36a0b7f712dbdb46a1 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 3 Oct 2021 21:46:06 -0700 Subject: [PATCH] Fix tractive flaky test (#57026) --- tests/components/tractive/test_config_flow.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/components/tractive/test_config_flow.py b/tests/components/tractive/test_config_flow.py index 7ccfdc63a34..115df39175c 100644 --- a/tests/components/tractive/test_config_flow.py +++ b/tests/components/tractive/test_config_flow.py @@ -121,7 +121,10 @@ async def test_reauthentication(hass): assert result["errors"] == {} assert result["step_id"] == "reauth_confirm" - with patch("aiotractive.api.API.user_id", return_value="USERID"): + with patch("aiotractive.api.API.user_id", return_value="USERID"), patch( + "homeassistant.components.tractive.async_setup_entry", + return_value=True, + ) as mock_setup_entry: result2 = await hass.config_entries.flow.async_configure( result["flow_id"], USER_INPUT, @@ -130,6 +133,7 @@ async def test_reauthentication(hass): assert result2["type"] == "abort" assert result2["reason"] == "reauth_successful" + assert len(mock_setup_entry.mock_calls) == 1 async def test_reauthentication_failure(hass):