Fix broad-exception-raised in component tests (#119467)

This commit is contained in:
epenet 2024-06-12 17:53:42 +02:00 committed by GitHub
parent aaa674955c
commit 3d1165519d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 9 additions and 9 deletions

View File

@ -71,7 +71,7 @@ def get_suggested(schema, key):
return None
return k.description["suggested_value"]
# Wanted key absent from schema
raise Exception
raise KeyError("Wanted key absent from schema")
@pytest.mark.parametrize("platform", ["sensor"])

View File

@ -205,7 +205,7 @@ def get_suggested(schema, key):
return None
return k.description["suggested_value"]
# Wanted key absent from schema
raise Exception
raise KeyError("Wanted key absent from schema")
@pytest.mark.parametrize(

View File

@ -164,7 +164,7 @@ def get_suggested(schema, key):
return None
return k.description["suggested_value"]
# Wanted key absent from schema
raise Exception
raise KeyError("Wanted key absent from schema")
@patch(

View File

@ -75,7 +75,7 @@ def get_suggested(schema, key):
return None
return k.description["suggested_value"]
# Wanted key absent from schema
raise Exception
raise KeyError("Wanted key absent from schema")
@pytest.mark.parametrize("platform", ["sensor"])

View File

@ -63,7 +63,7 @@ def get_suggested(schema, key):
return None
return k.description["suggested_value"]
# Wanted key absent from schema
raise Exception
raise KeyError("Wanted key absent from schema")
@pytest.mark.parametrize("platform", ["sensor"])

View File

@ -130,7 +130,7 @@ def get_suggested(schema, key):
return None
return k.description["suggested_value"]
# Wanted key absent from schema
raise Exception
raise KeyError("Wanted key absent from schema")
@pytest.mark.parametrize(

View File

@ -93,7 +93,7 @@ def get_suggested(schema, key):
return None
return k.description["suggested_value"]
# Wanted key absent from schema
raise Exception
raise KeyError("Wanted key absent from schema")
async def test_options(hass: HomeAssistant) -> None:

View File

@ -63,7 +63,7 @@ def get_suggested(schema, key):
return None
return k.description["suggested_value"]
# Wanted key absent from schema
raise Exception
raise KeyError("Wanted key absent from schema")
@pytest.mark.freeze_time("2022-03-16 17:37:00", tz_offset=-7)

View File

@ -261,7 +261,7 @@ def get_suggested(schema, key):
return None
return k.description["suggested_value"]
# Wanted key absent from schema
raise Exception
raise KeyError("Wanted key absent from schema")
async def test_options(hass: HomeAssistant) -> None: