From c09dcd29904e9de81dd77f893bf552da385320e8 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Wed, 21 Oct 2026 14:26:02 +0200 Subject: [PATCH] =?UTF-8?q?Return=20None=20from=20config=20entry=20method?= =?UTF-8?q?=20mocks=20in=20integration=20tests=20(batch=2014:=20sleep=5Fas?= =?UTF-8?q?=5Fandroid=E2=80=93swiss=5Fpublic=5Ftransport)=20(#187830)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Claude Opus 5.5 --- tests/components/sleep_as_android/conftest.py | 2 +- tests/components/sleepiq/conftest.py | 2 +- tests/components/slide_local/conftest.py | 2 +- tests/components/slimproto/conftest.py | 2 +- tests/components/sma/conftest.py | 2 +- tests/components/smappee/test_config_flow.py | 8 ++++---- tests/components/smarla/conftest.py | 2 +- .../smart_meter_texas/test_config_flow.py | 4 ++-- tests/components/smartthings/conftest.py | 2 +- tests/components/smarttub/test_config_flow.py | 2 +- tests/components/smarty/conftest.py | 2 +- tests/components/smartyplants/conftest.py | 2 +- tests/components/smhi/conftest.py | 2 +- tests/components/smhi/test_config_flow.py | 2 +- tests/components/smlight/conftest.py | 2 +- tests/components/smtp/conftest.py | 2 +- tests/components/snapcast/conftest.py | 2 +- tests/components/snoo/conftest.py | 2 +- tests/components/snooz/test_config_flow.py | 4 ++-- tests/components/sofar/conftest.py | 2 +- tests/components/solaredge/conftest.py | 2 +- tests/components/solarlog/conftest.py | 2 +- tests/components/solarman/conftest.py | 2 +- tests/components/solax/test_config_flow.py | 6 +++--- .../somfy_mylink/test_config_flow.py | 10 +++++----- tests/components/sonarr/conftest.py | 2 +- tests/components/sonarr/test_init.py | 2 +- tests/components/songpal/test_config_flow.py | 2 +- tests/components/sonos/test_config_flow.py | 10 +++++----- tests/components/sonos/test_init.py | 4 ++-- .../components/soundtouch/test_config_flow.py | 6 +++--- .../components/specialized_turbo/conftest.py | 3 +-- tests/components/speedtestdotnet/conftest.py | 2 +- tests/components/spin_ble/conftest.py | 2 +- tests/components/splunk/conftest.py | 2 +- tests/components/spotify/test_config_flow.py | 4 ++-- tests/components/sql/conftest.py | 2 +- tests/components/sql/test_config_flow.py | 4 ++-- tests/components/squeezebox/conftest.py | 2 +- tests/components/srp_energy/conftest.py | 2 +- .../components/srp_energy/test_config_flow.py | 2 +- tests/components/starline/test_config_flow.py | 4 ++-- tests/components/starlink/patchers.py | 2 +- tests/components/statistics/conftest.py | 2 +- tests/components/steam_online/conftest.py | 2 +- tests/components/steamist/test_config_flow.py | 20 +++++++++---------- .../steamvr_base_station/test_config_flow.py | 2 +- tests/components/stookwijzer/conftest.py | 2 +- tests/components/streamlabswater/conftest.py | 2 +- tests/components/suez_water/conftest.py | 2 +- tests/components/sun/test_config_flow.py | 2 +- tests/components/sunricher_dali/conftest.py | 2 +- tests/components/sunsynk/conftest.py | 2 +- .../surepetcare/test_config_flow.py | 6 +++--- .../swiss_public_transport/conftest.py | 2 +- 55 files changed, 87 insertions(+), 88 deletions(-) diff --git a/tests/components/sleep_as_android/conftest.py b/tests/components/sleep_as_android/conftest.py index 89f33a51e0b9..e38db74182d7 100644 --- a/tests/components/sleep_as_android/conftest.py +++ b/tests/components/sleep_as_android/conftest.py @@ -14,7 +14,7 @@ from homeassistant.const import CONF_WEBHOOK_ID def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.sleep_as_android.async_setup_entry", return_value=True + "homeassistant.components.sleep_as_android.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/sleepiq/conftest.py b/tests/components/sleepiq/conftest.py index c27ced85344e..8e511c04099f 100644 --- a/tests/components/sleepiq/conftest.py +++ b/tests/components/sleepiq/conftest.py @@ -50,7 +50,7 @@ SLEEPIQ_CONFIG = { def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.sleepiq.async_setup_entry", return_value=True + "homeassistant.components.sleepiq.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/slide_local/conftest.py b/tests/components/slide_local/conftest.py index 8f8272853605..85d111235575 100644 --- a/tests/components/slide_local/conftest.py +++ b/tests/components/slide_local/conftest.py @@ -56,6 +56,6 @@ def mock_slide_api() -> Generator[AsyncMock]: def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.slide_local.async_setup_entry", return_value=True + "homeassistant.components.slide_local.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/slimproto/conftest.py b/tests/components/slimproto/conftest.py index d3e3321cd97f..23225c8ee642 100644 --- a/tests/components/slimproto/conftest.py +++ b/tests/components/slimproto/conftest.py @@ -24,6 +24,6 @@ def mock_setup_entry() -> Generator[AsyncMock]: """Mock setting up a config entry.""" with patch( "homeassistant.components.slimproto.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup: yield mock_setup diff --git a/tests/components/sma/conftest.py b/tests/components/sma/conftest.py index 3ed16d48d8aa..e0a467074f6e 100644 --- a/tests/components/sma/conftest.py +++ b/tests/components/sma/conftest.py @@ -37,7 +37,7 @@ def mock_config_entry(hass: HomeAssistant) -> MockConfigEntry: def mock_setup_entry() -> Generator[AsyncMock]: """Mock the setup entry.""" with patch( - "homeassistant.components.sma.async_setup_entry", return_value=True + "homeassistant.components.sma.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/smappee/test_config_flow.py b/tests/components/smappee/test_config_flow.py index 22af3cacf9a3..83eda95b0327 100644 --- a/tests/components/smappee/test_config_flow.py +++ b/tests/components/smappee/test_config_flow.py @@ -475,7 +475,7 @@ async def test_full_user_flow( ) with patch( - "homeassistant.components.smappee.async_setup_entry", return_value=True + "homeassistant.components.smappee.async_setup_entry", return_value=None ) as mock_setup: await hass.config_entries.flow.async_configure(result["flow_id"]) @@ -498,7 +498,7 @@ async def test_full_zeroconf_flow(hass: HomeAssistant) -> None: "pysmappee.api.SmappeeLocalApi.load_instantaneous", return_value=[{"key": "phase0ActivePower", "value": 0}], ), - patch("homeassistant.components.smappee.async_setup_entry", return_value=True), + patch("homeassistant.components.smappee.async_setup_entry", return_value=None), ): result = await hass.config_entries.flow.async_init( DOMAIN, @@ -544,7 +544,7 @@ async def test_full_user_local_flow(hass: HomeAssistant) -> None: "pysmappee.api.SmappeeLocalApi.load_instantaneous", return_value=[{"key": "phase0ActivePower", "value": 0}], ), - patch("homeassistant.components.smappee.async_setup_entry", return_value=True), + patch("homeassistant.components.smappee.async_setup_entry", return_value=None), ): result = await hass.config_entries.flow.async_init( DOMAIN, @@ -666,7 +666,7 @@ async def test_reauth_flow( }, ) - with patch("homeassistant.components.smappee.async_setup_entry", return_value=True): + with patch("homeassistant.components.smappee.async_setup_entry", return_value=None): result = await hass.config_entries.flow.async_configure(result["flow_id"]) assert result["type"] is FlowResultType.ABORT diff --git a/tests/components/smarla/conftest.py b/tests/components/smarla/conftest.py index 2115faaa50b8..21a63d67fe21 100644 --- a/tests/components/smarla/conftest.py +++ b/tests/components/smarla/conftest.py @@ -29,7 +29,7 @@ def mock_config_entry() -> MockConfigEntry: @pytest.fixture def mock_setup_entry() -> Generator: """Override async_setup_entry.""" - with patch("homeassistant.components.smarla.async_setup_entry", return_value=True): + with patch("homeassistant.components.smarla.async_setup_entry", return_value=None): yield diff --git a/tests/components/smart_meter_texas/test_config_flow.py b/tests/components/smart_meter_texas/test_config_flow.py index 8e3554aebe27..9e576a468a8e 100644 --- a/tests/components/smart_meter_texas/test_config_flow.py +++ b/tests/components/smart_meter_texas/test_config_flow.py @@ -28,7 +28,7 @@ def _patch_success() -> Generator[None]: patch("smart_meter_texas.Client.authenticate", return_value=True), patch( "homeassistant.components.smart_meter_texas.async_setup_entry", - return_value=True, + return_value=None, ), ): yield @@ -47,7 +47,7 @@ async def test_form(hass: HomeAssistant) -> None: patch("smart_meter_texas.Client.authenticate", return_value=True), patch( "homeassistant.components.smart_meter_texas.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry, ): result2 = await hass.config_entries.flow.async_configure( diff --git a/tests/components/smartthings/conftest.py b/tests/components/smartthings/conftest.py index 7463457b0c42..60a38aa37267 100644 --- a/tests/components/smartthings/conftest.py +++ b/tests/components/smartthings/conftest.py @@ -40,7 +40,7 @@ def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( "homeassistant.components.smartthings.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/smarttub/test_config_flow.py b/tests/components/smarttub/test_config_flow.py index f0c38854ad0d..beb39f319de0 100644 --- a/tests/components/smarttub/test_config_flow.py +++ b/tests/components/smarttub/test_config_flow.py @@ -18,7 +18,7 @@ def mock_setup_entry(): """Mock the integration setup.""" with patch( "homeassistant.components.smarttub.async_setup_entry", - return_value=True, + return_value=None, ) as mock: yield mock diff --git a/tests/components/smarty/conftest.py b/tests/components/smarty/conftest.py index 479f4b813833..30b55a7c45f8 100644 --- a/tests/components/smarty/conftest.py +++ b/tests/components/smarty/conftest.py @@ -15,7 +15,7 @@ def mock_setup_entry() -> Generator[AsyncMock]: """Override integration setup.""" with patch( "homeassistant.components.smarty.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/smartyplants/conftest.py b/tests/components/smartyplants/conftest.py index c7bf5bd4c9b1..05e088848893 100644 --- a/tests/components/smartyplants/conftest.py +++ b/tests/components/smartyplants/conftest.py @@ -21,7 +21,7 @@ WEBHOOK_SECRET = "top-secret" def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.smartyplants.async_setup_entry", return_value=True + "homeassistant.components.smartyplants.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/smhi/conftest.py b/tests/components/smhi/conftest.py index 5c948ba97f32..11ff8c3e2dbc 100644 --- a/tests/components/smhi/conftest.py +++ b/tests/components/smhi/conftest.py @@ -24,7 +24,7 @@ from . import TEST_CONFIG def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.smhi.async_setup_entry", return_value=True + "homeassistant.components.smhi.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/smhi/test_config_flow.py b/tests/components/smhi/test_config_flow.py index 6fb0a107120f..6fd5210eb8ae 100644 --- a/tests/components/smhi/test_config_flow.py +++ b/tests/components/smhi/test_config_flow.py @@ -36,7 +36,7 @@ async def test_form( with patch( "homeassistant.components.smhi.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry: result = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/smlight/conftest.py b/tests/components/smlight/conftest.py index 823be1be298e..b6cdd9f64f05 100644 --- a/tests/components/smlight/conftest.py +++ b/tests/components/smlight/conftest.py @@ -93,7 +93,7 @@ async def mock_patch_platforms(platforms: list[str]) -> AsyncGenerator[None]: def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.smlight.async_setup_entry", return_value=True + "homeassistant.components.smlight.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/smtp/conftest.py b/tests/components/smtp/conftest.py index cb7c679e5484..b1b7131661c2 100644 --- a/tests/components/smtp/conftest.py +++ b/tests/components/smtp/conftest.py @@ -41,7 +41,7 @@ USER_INPUT = { def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.smtp.async_setup_entry", return_value=True + "homeassistant.components.smtp.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/snapcast/conftest.py b/tests/components/snapcast/conftest.py index 4784dc0b1c06..17705cf2bece 100644 --- a/tests/components/snapcast/conftest.py +++ b/tests/components/snapcast/conftest.py @@ -18,7 +18,7 @@ from homeassistant.const import CONF_HOST, CONF_PORT def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.snapcast.async_setup_entry", return_value=True + "homeassistant.components.snapcast.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/snoo/conftest.py b/tests/components/snoo/conftest.py index 6163fa56b7f4..d74896640e84 100644 --- a/tests/components/snoo/conftest.py +++ b/tests/components/snoo/conftest.py @@ -13,7 +13,7 @@ from .const import MOCK_SNOO_DEVICES, MOCKED_AUTH def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.snoo.async_setup_entry", return_value=True + "homeassistant.components.snoo.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/snooz/test_config_flow.py b/tests/components/snooz/test_config_flow.py index a8f14f8748eb..1e90070c99bf 100644 --- a/tests/components/snooz/test_config_flow.py +++ b/tests/components/snooz/test_config_flow.py @@ -171,7 +171,7 @@ async def test_async_step_user_device_added_between_steps(hass: HomeAssistant) - ) entry.add_to_hass(hass) - with patch("homeassistant.components.snooz.async_setup_entry", return_value=True): + with patch("homeassistant.components.snooz.async_setup_entry", return_value=None): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={CONF_NAME: TEST_SNOOZ_DISPLAY_NAME}, @@ -359,7 +359,7 @@ async def _test_pairs_timeout( async def _test_setup_entry( hass: HomeAssistant, flow_id: str, user_input: dict | None = None ) -> None: - with patch("homeassistant.components.snooz.async_setup_entry", return_value=True): + with patch("homeassistant.components.snooz.async_setup_entry", return_value=None): result = await hass.config_entries.flow.async_configure( flow_id, user_input=user_input or {}, diff --git a/tests/components/sofar/conftest.py b/tests/components/sofar/conftest.py index febe5ee43e1c..dc293388ad2e 100644 --- a/tests/components/sofar/conftest.py +++ b/tests/components/sofar/conftest.py @@ -19,7 +19,7 @@ def mock_setup_entry() -> Generator[AsyncMock]: with patch( "homeassistant.components.sofar.async_setup_entry", new_callable=AsyncMock, - return_value=True, + return_value=None, ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/solaredge/conftest.py b/tests/components/solaredge/conftest.py index b1d4288915f9..e41d4987f7aa 100644 --- a/tests/components/solaredge/conftest.py +++ b/tests/components/solaredge/conftest.py @@ -23,7 +23,7 @@ def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( "homeassistant.components.solaredge.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/solarlog/conftest.py b/tests/components/solarlog/conftest.py index de692231a70f..eba7d38f5517 100644 --- a/tests/components/solarlog/conftest.py +++ b/tests/components/solarlog/conftest.py @@ -79,7 +79,7 @@ def mock_solarlog_connector(): def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.solarlog.async_setup_entry", return_value=True + "homeassistant.components.solarlog.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/solarman/conftest.py b/tests/components/solarman/conftest.py index b9c5d4577d97..dfdffc7abf71 100644 --- a/tests/components/solarman/conftest.py +++ b/tests/components/solarman/conftest.py @@ -65,6 +65,6 @@ def mock_solarman(device_fixture: str) -> Generator[AsyncMock]: def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.solarman.async_setup_entry", return_value=True + "homeassistant.components.solarman.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/solax/test_config_flow.py b/tests/components/solax/test_config_flow.py index 382f055b7064..526fe85a96bc 100644 --- a/tests/components/solax/test_config_flow.py +++ b/tests/components/solax/test_config_flow.py @@ -78,7 +78,7 @@ async def test_form_success( patch("solax.RealTimeAPI.get_data", return_value=__mock_get_data()), patch( "homeassistant.components.solax.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry, ): result = flow @@ -133,7 +133,7 @@ async def test_form_discover_error( patch("solax.RealTimeAPI.get_data", return_value=__mock_get_data()), patch( "homeassistant.components.solax.async_setup_entry", - return_value=True, + return_value=None, ), ): result = await hass.config_entries.flow.async_configure( @@ -202,7 +202,7 @@ async def test_form_finalize_error( patch("solax.RealTimeAPI.get_data", return_value=__mock_get_data()), patch( "homeassistant.components.solax.async_setup_entry", - return_value=True, + return_value=None, ), ): result = await hass.config_entries.flow.async_configure( diff --git a/tests/components/somfy_mylink/test_config_flow.py b/tests/components/somfy_mylink/test_config_flow.py index b3ad44b6780f..002e510f157a 100644 --- a/tests/components/somfy_mylink/test_config_flow.py +++ b/tests/components/somfy_mylink/test_config_flow.py @@ -36,7 +36,7 @@ def _patch_success() -> Generator[None]: ), patch( "homeassistant.components.somfy_mylink.async_setup_entry", - return_value=True, + return_value=None, ), ): yield @@ -58,7 +58,7 @@ async def test_form_user(hass: HomeAssistant) -> None: ), patch( "homeassistant.components.somfy_mylink.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry, ): result2 = await hass.config_entries.flow.async_configure( @@ -103,7 +103,7 @@ async def test_form_user_already_configured(hass: HomeAssistant) -> None: ), patch( "homeassistant.components.somfy_mylink.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry, ): result2 = await hass.config_entries.flow.async_configure( @@ -291,7 +291,7 @@ async def test_form_user_already_configured_from_dhcp(hass: HomeAssistant) -> No ), patch( "homeassistant.components.somfy_mylink.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry, ): result = await hass.config_entries.flow.async_init( @@ -352,7 +352,7 @@ async def test_dhcp_discovery(hass: HomeAssistant) -> None: ), patch( "homeassistant.components.somfy_mylink.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry, ): result2 = await hass.config_entries.flow.async_configure( diff --git a/tests/components/sonarr/conftest.py b/tests/components/sonarr/conftest.py index 28e2a1010920..4d8d5c54fbbd 100644 --- a/tests/components/sonarr/conftest.py +++ b/tests/components/sonarr/conftest.py @@ -127,7 +127,7 @@ def mock_config_entry() -> MockConfigEntry: @pytest.fixture def mock_setup_entry() -> Generator[None]: """Mock setting up a config entry.""" - with patch("homeassistant.components.sonarr.async_setup_entry", return_value=True): + with patch("homeassistant.components.sonarr.async_setup_entry", return_value=None): yield diff --git a/tests/components/sonarr/test_init.py b/tests/components/sonarr/test_init.py index ae9d0be3838c..7f8cdddf1746 100644 --- a/tests/components/sonarr/test_init.py +++ b/tests/components/sonarr/test_init.py @@ -97,7 +97,7 @@ async def test_migrate_config_entry(hass: HomeAssistant) -> None: assert entry.version == 1 assert not entry.unique_id - with patch("homeassistant.components.sonarr.async_setup_entry", return_value=True): + with patch("homeassistant.components.sonarr.async_setup_entry", return_value=None): await hass.config_entries.async_setup(entry.entry_id) await hass.async_block_till_done() diff --git a/tests/components/songpal/test_config_flow.py b/tests/components/songpal/test_config_flow.py index b3ca85206e7f..4662b0873aff 100644 --- a/tests/components/songpal/test_config_flow.py +++ b/tests/components/songpal/test_config_flow.py @@ -62,7 +62,7 @@ def _flow_next(hass: HomeAssistant, flow_id: str) -> ConfigFlowResult: def _patch_setup(): return patch( "homeassistant.components.songpal.async_setup_entry", - return_value=True, + return_value=None, ) diff --git a/tests/components/sonos/test_config_flow.py b/tests/components/sonos/test_config_flow.py index 0501686ac4e6..a026a0547e3b 100644 --- a/tests/components/sonos/test_config_flow.py +++ b/tests/components/sonos/test_config_flow.py @@ -49,7 +49,7 @@ async def test_user_form( ) as mock_setup, patch( "homeassistant.components.sonos.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry, ): result2 = await hass.config_entries.flow.async_configure( @@ -71,7 +71,7 @@ async def test_user_form_already_created(hass: HomeAssistant) -> None: config = {DOMAIN: {MP_DOMAIN: {CONF_HOSTS: "192.168.4.2"}}} with patch( "homeassistant.components.sonos.async_setup_entry", - return_value=True, + return_value=None, ): await async_setup_component(hass, DOMAIN, config) await hass.async_block_till_done() @@ -104,7 +104,7 @@ async def test_zeroconf_form( ) as mock_setup, patch( "homeassistant.components.sonos.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry, ): result2 = await hass.config_entries.flow.async_configure( @@ -166,7 +166,7 @@ async def test_ssdp_discovery(hass: HomeAssistant, soco) -> None: ) as mock_setup, patch( "homeassistant.components.sonos.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry, ): result = await hass.config_entries.flow.async_configure( @@ -220,7 +220,7 @@ async def test_zeroconf_sonos_v1(hass: HomeAssistant) -> None: ) as mock_setup, patch( "homeassistant.components.sonos.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry, ): result2 = await hass.config_entries.flow.async_configure( diff --git a/tests/components/sonos/test_init.py b/tests/components/sonos/test_init.py index d2e18051eff4..2f3a21ad20e9 100644 --- a/tests/components/sonos/test_init.py +++ b/tests/components/sonos/test_init.py @@ -72,7 +72,7 @@ async def test_configuring_sonos_creates_entry(hass: HomeAssistant) -> None: """Test that specifying config will create an entry.""" with patch( "homeassistant.components.sonos.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup: await async_setup_component( hass, @@ -88,7 +88,7 @@ async def test_not_configuring_sonos_not_creates_entry(hass: HomeAssistant) -> N """Test that no config will not create an entry.""" with patch( "homeassistant.components.sonos.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup: await async_setup_component(hass, sonos.DOMAIN, {}) await hass.async_block_till_done() diff --git a/tests/components/soundtouch/test_config_flow.py b/tests/components/soundtouch/test_config_flow.py index 0fbe1b17265a..c90a541d4677 100644 --- a/tests/components/soundtouch/test_config_flow.py +++ b/tests/components/soundtouch/test_config_flow.py @@ -30,7 +30,7 @@ async def test_user_flow_create_entry( assert result.get("step_id") == "user" with patch( - "homeassistant.components.soundtouch.async_setup_entry", return_value=True + "homeassistant.components.soundtouch.async_setup_entry", return_value=None ) as mock_setup_entry: result = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -70,7 +70,7 @@ async def test_user_flow_cannot_connect( requests_mock.get(f"{DEVICE_1_URL}/info", text=device1_info) with patch( - "homeassistant.components.soundtouch.async_setup_entry", return_value=True + "homeassistant.components.soundtouch.async_setup_entry", return_value=None ): result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={CONF_HOST: DEVICE_1_IP} @@ -107,7 +107,7 @@ async def test_zeroconf_flow_create_entry( assert result.get("description_placeholders") == {"name": DEVICE_1_NAME} with patch( - "homeassistant.components.soundtouch.async_setup_entry", return_value=True + "homeassistant.components.soundtouch.async_setup_entry", return_value=None ) as mock_setup_entry: result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={} diff --git a/tests/components/specialized_turbo/conftest.py b/tests/components/specialized_turbo/conftest.py index 5822d27d1230..3a56b86da96b 100644 --- a/tests/components/specialized_turbo/conftest.py +++ b/tests/components/specialized_turbo/conftest.py @@ -187,11 +187,10 @@ def mock_setup_entry() -> Generator[AsyncMock]: async def setup_entry( _hass: HomeAssistant, entry: ConfigEntry, - ) -> bool: + ) -> None: runtime_data = MagicMock() runtime_data.async_shutdown = AsyncMock() entry.runtime_data = runtime_data - return True with patch( "homeassistant.components.specialized_turbo.async_setup_entry", diff --git a/tests/components/speedtestdotnet/conftest.py b/tests/components/speedtestdotnet/conftest.py index fc30fe02ad86..696af211116d 100644 --- a/tests/components/speedtestdotnet/conftest.py +++ b/tests/components/speedtestdotnet/conftest.py @@ -12,7 +12,7 @@ def mock_setup_entry(): """Mock setting up a config entry.""" with patch( "homeassistant.components.speedtestdotnet.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup: yield mock_setup diff --git a/tests/components/spin_ble/conftest.py b/tests/components/spin_ble/conftest.py index 73dc12762712..bb145f382395 100644 --- a/tests/components/spin_ble/conftest.py +++ b/tests/components/spin_ble/conftest.py @@ -120,6 +120,6 @@ def mock_config_entry() -> MockConfigEntry: def mock_setup_entry() -> Generator[AsyncMock]: """Stop the entry a flow creates from setting the integration up.""" with patch( - "homeassistant.components.spin_ble.async_setup_entry", return_value=True + "homeassistant.components.spin_ble.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/splunk/conftest.py b/tests/components/splunk/conftest.py index ffd51eb7c173..194c24791ec3 100644 --- a/tests/components/splunk/conftest.py +++ b/tests/components/splunk/conftest.py @@ -20,7 +20,7 @@ from homeassistant.const import ( def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.splunk.async_setup_entry", return_value=True + "homeassistant.components.splunk.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/spotify/test_config_flow.py b/tests/components/spotify/test_config_flow.py index d2428a94645c..d9d0f039adcf 100644 --- a/tests/components/spotify/test_config_flow.py +++ b/tests/components/spotify/test_config_flow.py @@ -76,7 +76,7 @@ async def test_full_flow( ) with ( - patch("homeassistant.components.spotify.async_setup_entry", return_value=True), + patch("homeassistant.components.spotify.async_setup_entry", return_value=None), ): result = await hass.config_entries.flow.async_configure(result["flow_id"]) @@ -228,7 +228,7 @@ async def test_reauthentication( ) with ( - patch("homeassistant.components.spotify.async_setup_entry", return_value=True), + patch("homeassistant.components.spotify.async_setup_entry", return_value=None), ): result = await hass.config_entries.flow.async_configure(result["flow_id"]) diff --git a/tests/components/sql/conftest.py b/tests/components/sql/conftest.py index 0c84ad1b2124..549f74309baf 100644 --- a/tests/components/sql/conftest.py +++ b/tests/components/sql/conftest.py @@ -10,6 +10,6 @@ import pytest def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.sql.async_setup_entry", return_value=True + "homeassistant.components.sql.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/sql/test_config_flow.py b/tests/components/sql/test_config_flow.py index 9d6890b695b8..270f13fb9062 100644 --- a/tests/components/sql/test_config_flow.py +++ b/tests/components/sql/test_config_flow.py @@ -120,7 +120,7 @@ async def test_form_with_query_template( with patch( "homeassistant.components.sql.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry: result = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -172,7 +172,7 @@ async def test_form_with_broken_query_template( with patch( "homeassistant.components.sql.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry: result = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/squeezebox/conftest.py b/tests/components/squeezebox/conftest.py index 759e7ce64f5e..30ab87f672e2 100644 --- a/tests/components/squeezebox/conftest.py +++ b/tests/components/squeezebox/conftest.py @@ -121,7 +121,7 @@ FAKE_QUERY_RESPONSE = { def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.squeezebox.async_setup_entry", return_value=True + "homeassistant.components.squeezebox.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/srp_energy/conftest.py b/tests/components/srp_energy/conftest.py index a5ee02ce44ec..4eab454655d2 100644 --- a/tests/components/srp_energy/conftest.py +++ b/tests/components/srp_energy/conftest.py @@ -122,6 +122,6 @@ async def init_integration( def mock_setup_entry() -> Generator[MagicMock]: """Mock async_setup_entry.""" with patch( - "homeassistant.components.srp_energy.async_setup_entry", return_value=True + "homeassistant.components.srp_energy.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/srp_energy/test_config_flow.py b/tests/components/srp_energy/test_config_flow.py index 453893936602..1eddfc516c6f 100644 --- a/tests/components/srp_energy/test_config_flow.py +++ b/tests/components/srp_energy/test_config_flow.py @@ -46,7 +46,7 @@ async def test_show_form( with patch( "homeassistant.components.srp_energy.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry: result = await hass.config_entries.flow.async_configure( flow_id=result["flow_id"], user_input=TEST_CONFIG_HOME diff --git a/tests/components/starline/test_config_flow.py b/tests/components/starline/test_config_flow.py index 1a59256c574d..7a2dd0ac6d54 100644 --- a/tests/components/starline/test_config_flow.py +++ b/tests/components/starline/test_config_flow.py @@ -139,7 +139,7 @@ async def test_step_auth_app_code_falls(hass: HomeAssistant) -> None: assert result["step_id"] == "auth_user" with patch( - "homeassistant.components.starline.async_setup_entry", return_value=True + "homeassistant.components.starline.async_setup_entry", return_value=None ): result = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -191,7 +191,7 @@ async def test_step_auth_app_token_falls(hass: HomeAssistant) -> None: assert result["step_id"] == "auth_user" with patch( - "homeassistant.components.starline.async_setup_entry", return_value=True + "homeassistant.components.starline.async_setup_entry", return_value=None ): result = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/starlink/patchers.py b/tests/components/starlink/patchers.py index b759ed8cf0fa..8e16363bceb6 100644 --- a/tests/components/starlink/patchers.py +++ b/tests/components/starlink/patchers.py @@ -8,7 +8,7 @@ from pytest_homeassistant.common import ( ) SETUP_ENTRY_PATCHER = patch( - "homeassistant.components.starlink.async_setup_entry", return_value=True + "homeassistant.components.starlink.async_setup_entry", return_value=None ) LOCATION_DATA_SUCCESS_PATCHER = patch( diff --git a/tests/components/statistics/conftest.py b/tests/components/statistics/conftest.py index fb9f25a17d9e..ef97d1557ef7 100644 --- a/tests/components/statistics/conftest.py +++ b/tests/components/statistics/conftest.py @@ -35,7 +35,7 @@ def mock_setup_entry() -> Generator[AsyncMock]: """Automatically path uuid generator.""" with patch( "homeassistant.components.statistics.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/steam_online/conftest.py b/tests/components/steam_online/conftest.py index e9fd4ce63f84..afd16df7a008 100644 --- a/tests/components/steam_online/conftest.py +++ b/tests/components/steam_online/conftest.py @@ -41,7 +41,7 @@ def mock_config_entry() -> MockConfigEntry: def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.steam_online.async_setup_entry", return_value=True + "homeassistant.components.steam_online.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/steamist/test_config_flow.py b/tests/components/steamist/test_config_flow.py index 25b7f1f751b5..184ac668cccb 100644 --- a/tests/components/steamist/test_config_flow.py +++ b/tests/components/steamist/test_config_flow.py @@ -52,7 +52,7 @@ async def test_form(hass: HomeAssistant) -> None: ), patch( "homeassistant.components.steamist.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry, ): result2 = await hass.config_entries.flow.async_configure( @@ -87,7 +87,7 @@ async def test_form_with_discovery(hass: HomeAssistant) -> None: ), patch( "homeassistant.components.steamist.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry, ): result2 = await hass.config_entries.flow.async_configure( @@ -132,7 +132,7 @@ async def test_form_cannot_connect(hass: HomeAssistant) -> None: ), patch( "homeassistant.components.steamist.async_setup_entry", - return_value=True, + return_value=None, ), ): result3 = await hass.config_entries.flow.async_configure( @@ -172,7 +172,7 @@ async def test_form_unknown_exception(hass: HomeAssistant) -> None: ), patch( "homeassistant.components.steamist.async_setup_entry", - return_value=True, + return_value=None, ), ): result3 = await hass.config_entries.flow.async_configure( @@ -220,7 +220,7 @@ async def test_discovery(hass: HomeAssistant) -> None: _patch_discovery(), _patch_status(MOCK_ASYNC_GET_STATUS_INACTIVE), patch(f"{MODULE}.async_setup", return_value=True) as mock_setup, - patch(f"{MODULE}.async_setup_entry", return_value=True) as mock_setup_entry, + patch(f"{MODULE}.async_setup_entry", return_value=None) as mock_setup_entry, ): result3 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -308,7 +308,7 @@ async def test_discovered_by_discovery(hass: HomeAssistant) -> None: _patch_status(MOCK_ASYNC_GET_STATUS_INACTIVE), patch(f"{MODULE}.async_setup", return_value=True) as mock_async_setup, patch( - f"{MODULE}.async_setup_entry", return_value=True + f"{MODULE}.async_setup_entry", return_value=None ) as mock_async_setup_entry, ): result2 = await hass.config_entries.flow.async_configure(result["flow_id"], {}) @@ -340,7 +340,7 @@ async def test_discovered_by_dhcp(hass: HomeAssistant) -> None: _patch_status(MOCK_ASYNC_GET_STATUS_INACTIVE), patch(f"{MODULE}.async_setup", return_value=True) as mock_async_setup, patch( - f"{MODULE}.async_setup_entry", return_value=True + f"{MODULE}.async_setup_entry", return_value=None ) as mock_async_setup_entry, ): result2 = await hass.config_entries.flow.async_configure(result["flow_id"], {}) @@ -409,7 +409,7 @@ async def test_discovered_by_dhcp_or_discovery_adds_missing_unique_id( _patch_discovery(), _patch_status(MOCK_ASYNC_GET_STATUS_INACTIVE), patch(f"{MODULE}.async_setup", return_value=True) as mock_setup, - patch(f"{MODULE}.async_setup_entry", return_value=True) as mock_setup_entry, + patch(f"{MODULE}.async_setup_entry", return_value=None) as mock_setup_entry, ): result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": source}, data=data @@ -444,7 +444,7 @@ async def test_discovered_by_dhcp_or_discovery_existing_unique_id_does_not_reloa _patch_discovery(), _patch_status(MOCK_ASYNC_GET_STATUS_INACTIVE), patch(f"{MODULE}.async_setup", return_value=True) as mock_setup, - patch(f"{MODULE}.async_setup_entry", return_value=True) as mock_setup_entry, + patch(f"{MODULE}.async_setup_entry", return_value=None) as mock_setup_entry, ): result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": source}, data=data @@ -488,7 +488,7 @@ async def test_pick_device_replaces_ignored_device(hass: HomeAssistant) -> None: _patch_discovery(), _patch_status(MOCK_ASYNC_GET_STATUS_INACTIVE), patch(f"{MODULE}.async_setup", return_value=True), - patch(f"{MODULE}.async_setup_entry", return_value=True), + patch(f"{MODULE}.async_setup_entry", return_value=None), ): result3 = await hass.config_entries.flow.async_configure( result2["flow_id"], diff --git a/tests/components/steamvr_base_station/test_config_flow.py b/tests/components/steamvr_base_station/test_config_flow.py index 2bbd868e51ff..c47f8bf0ebcf 100644 --- a/tests/components/steamvr_base_station/test_config_flow.py +++ b/tests/components/steamvr_base_station/test_config_flow.py @@ -26,7 +26,7 @@ def mock_setup_entry() -> Generator[None]: """Prevent the integration from setting up after the flow.""" with patch( "homeassistant.components.steamvr_base_station.async_setup_entry", - return_value=True, + return_value=None, ): yield diff --git a/tests/components/stookwijzer/conftest.py b/tests/components/stookwijzer/conftest.py index 7e15af498ec9..673cb2bd0ccc 100644 --- a/tests/components/stookwijzer/conftest.py +++ b/tests/components/stookwijzer/conftest.py @@ -48,7 +48,7 @@ def mock_v1_config_entry() -> MockConfigEntry: def mock_setup_entry() -> Generator[AsyncMock]: """Mock setting up a config entry.""" with patch( - "homeassistant.components.stookwijzer.async_setup_entry", return_value=True + "homeassistant.components.stookwijzer.async_setup_entry", return_value=None ) as mock_setup: yield mock_setup diff --git a/tests/components/streamlabswater/conftest.py b/tests/components/streamlabswater/conftest.py index b22f12412633..ae2164610134 100644 --- a/tests/components/streamlabswater/conftest.py +++ b/tests/components/streamlabswater/conftest.py @@ -15,7 +15,7 @@ from homeassistant.const import CONF_API_KEY def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.streamlabswater.async_setup_entry", return_value=True + "homeassistant.components.streamlabswater.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/suez_water/conftest.py b/tests/components/suez_water/conftest.py index 914575f1fa00..b25917ba899f 100644 --- a/tests/components/suez_water/conftest.py +++ b/tests/components/suez_water/conftest.py @@ -43,7 +43,7 @@ def mock_config_entry() -> MockConfigEntry: def mock_setup_entry(recorder_mock: Recorder) -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.suez_water.async_setup_entry", return_value=True + "homeassistant.components.suez_water.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/sun/test_config_flow.py b/tests/components/sun/test_config_flow.py index 74e0e0bad888..0b794225a04d 100644 --- a/tests/components/sun/test_config_flow.py +++ b/tests/components/sun/test_config_flow.py @@ -22,7 +22,7 @@ async def test_full_user_flow(hass: HomeAssistant) -> None: with patch( "homeassistant.components.sun.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry: result = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/sunricher_dali/conftest.py b/tests/components/sunricher_dali/conftest.py index ca5b7e9b0654..89a44460e8d4 100644 --- a/tests/components/sunricher_dali/conftest.py +++ b/tests/components/sunricher_dali/conftest.py @@ -325,6 +325,6 @@ def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( "homeassistant.components.sunricher_dali.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/sunsynk/conftest.py b/tests/components/sunsynk/conftest.py index 8eecc4b62111..e10d7a3d7f84 100644 --- a/tests/components/sunsynk/conftest.py +++ b/tests/components/sunsynk/conftest.py @@ -28,7 +28,7 @@ USER_ID = "281092" def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.sunsynk.async_setup_entry", return_value=True + "homeassistant.components.sunsynk.async_setup_entry", return_value=None ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/surepetcare/test_config_flow.py b/tests/components/surepetcare/test_config_flow.py index 462d70a77c8e..7ce18180352d 100644 --- a/tests/components/surepetcare/test_config_flow.py +++ b/tests/components/surepetcare/test_config_flow.py @@ -29,7 +29,7 @@ def _patch_success() -> Generator[None]: ), patch( "homeassistant.components.surepetcare.async_setup_entry", - return_value=True, + return_value=None, ), ): yield @@ -46,7 +46,7 @@ async def test_form(hass: HomeAssistant, surepetcare: NonCallableMagicMock) -> N with patch( "homeassistant.components.surepetcare.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry: result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -178,7 +178,7 @@ async def test_flow_entry_already_exists( with patch( "homeassistant.components.surepetcare.async_setup_entry", - return_value=True, + return_value=None, ): result = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/swiss_public_transport/conftest.py b/tests/components/swiss_public_transport/conftest.py index 90c16d9f0848..ef9feeac8389 100644 --- a/tests/components/swiss_public_transport/conftest.py +++ b/tests/components/swiss_public_transport/conftest.py @@ -56,6 +56,6 @@ def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( "homeassistant.components.swiss_public_transport.async_setup_entry", - return_value=True, + return_value=None, ) as mock_setup_entry: yield mock_setup_entry