Fix otbr flaky config flow tests in Python 3.14.3#169348
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes flaky OTBR config flow tests on Python 3.14.3 by ensuring the Silicon Labs Multiprotocol add-on manager is pre-seeded in hass.data, preventing a late platform callback from accessing missing ConfigEntry.runtime_data in a mocked setup path.
Changes:
- Add the existing
multiprotocol_addon_manager_mockfixture to two hassio discovery flow tests to avoid lazy manager initialization side effects.
sairon
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking change
Proposed change
Spotted in https://github.com/home-assistant/core/actions/runs/25039807993/job/73341207506?pr=162263 and needed for #162263.
The tests
test_hassio_discovery_flow_router_not_setupandtest_hassio_discovery_flow_router_not_setup_has_preferredfail under Python 3.14.3 with:Both tests use the multiprotocol URL
http://core-silabs-multiprotocol:8081and patchasync_setup_entryto returnTruewithout settingruntime_data. When the flow exercises the_set_datasetpath it callsget_allowed_channel, which lazily initializes theMultiprotocolAddonManager. Once otbr'scomponent_loadedevent fires, the manager's platform callback iterates loaded entries and dereferencesconfig_entry.runtime_data— which the mock never set — raising theAttributeError.Fix by adding the existing
multiprotocol_addon_manager_mockfixture (already used bytest_hassio_discovery_flow_router_not_setup_has_preferred_2) so the manager singleton is pre-installed and the platform discovery callback never runs.Type of change
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running: `python3 -m script.hassfest`.
Updated by running `python3 -m script.gen_requirements_all`.
🤖 Generated with Claude Code