Catch all exceptions on import component/platform (#64930)

This commit is contained in:
Paulus Schoutsen
2022-01-25 20:39:32 -08:00
committed by GitHub
parent a24f79434f
commit 24546dfdf9
4 changed files with 48 additions and 10 deletions

View File

@@ -577,7 +577,7 @@ async def test_async_when_setup_or_start_already_loaded(hass):
async def test_setup_import_blows_up(hass):
"""Test that we handle it correctly when importing integration blows up."""
with patch(
"homeassistant.loader.Integration.get_component", side_effect=ValueError
"homeassistant.loader.Integration.get_component", side_effect=ImportError
):
assert not await setup.async_setup_component(hass, "sun", {})