mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 19:25:12 +02:00
Fix broad-exception-raised in component tests (#119467)
This commit is contained in:
@@ -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"])
|
||||
|
@@ -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(
|
||||
|
@@ -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(
|
||||
|
@@ -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"])
|
||||
|
@@ -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"])
|
||||
|
@@ -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(
|
||||
|
@@ -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:
|
||||
|
@@ -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)
|
||||
|
@@ -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:
|
||||
|
Reference in New Issue
Block a user