Raise and suppress stack trace when reloading yaml fails (#102410)
* Allow async_integration_yaml_config to raise * Docstr - split check * Implement as wrapper, return dataclass * Fix setup error handling * Fix reload test mock * Move log_messages to error handler * Remove unreachable code * Remove config test helper * Refactor and ensure notifications during setup * Remove redundat error, adjust tests notifications * Fix patch * Apply suggestions from code review Co-authored-by: Erik Montnemery <erik@montnemery.com> * Follow up comments * Add call_back decorator * Split long lines * Update exception abbreviations --------- Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
parent
852fb58ca8
commit
af71c2bb45
15 changed files with 954 additions and 195 deletions
|
@ -984,7 +984,10 @@ def assert_setup_component(count, domain=None):
|
|||
async def mock_psc(hass, config_input, integration):
|
||||
"""Mock the prepare_setup_component to capture config."""
|
||||
domain_input = integration.domain
|
||||
res = await async_process_component_config(hass, config_input, integration)
|
||||
integration_config_info = await async_process_component_config(
|
||||
hass, config_input, integration
|
||||
)
|
||||
res = integration_config_info.config
|
||||
config[domain_input] = None if res is None else res.get(domain_input)
|
||||
_LOGGER.debug(
|
||||
"Configuration for %s, Validated: %s, Original %s",
|
||||
|
@ -992,7 +995,7 @@ def assert_setup_component(count, domain=None):
|
|||
config[domain_input],
|
||||
config_input.get(domain_input),
|
||||
)
|
||||
return res
|
||||
return integration_config_info
|
||||
|
||||
assert isinstance(config, dict)
|
||||
with patch("homeassistant.config.async_process_component_config", mock_psc):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue