mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Don't try and store exceptions when the key is missing (#41803)
This commit is contained in:
parent
8bc47c0cd1
commit
2b151209b2
@ -109,7 +109,18 @@ def hass(loop, hass_storage, request):
|
||||
|
||||
def exc_handle(loop, context):
|
||||
"""Handle exceptions by rethrowing them, which will fail the test."""
|
||||
exceptions.append(context["exception"])
|
||||
# Most of these contexts will contain an exception, but not all.
|
||||
# The docs note the key as "optional"
|
||||
# See https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.call_exception_handler
|
||||
if "exception" in context:
|
||||
exceptions.append(context["exception"])
|
||||
else:
|
||||
exceptions.append(
|
||||
Exception(
|
||||
"Received exception handler without exception, but with message: %s"
|
||||
% context["message"]
|
||||
)
|
||||
)
|
||||
orig_exception_handler(loop, context)
|
||||
|
||||
exceptions = []
|
||||
|
@ -16,4 +16,6 @@ IGNORE_UNCAUGHT_EXCEPTIONS = [
|
||||
"tests.components.unifi.test_controller",
|
||||
"test_wireless_client_event_calls_update_wireless_devices",
|
||||
),
|
||||
("tests.components.iaqualink.test_config_flow", "test_with_invalid_credentials"),
|
||||
("tests.components.iaqualink.test_config_flow", "test_with_existing_config"),
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user