Re-raise annotated_yaml.YAMLException as HomeAssistantError (#147129)
* Re-raise annotated_yaml.YAMLException as HomeAssistantError * Fix comment
This commit is contained in:
@@ -559,6 +559,10 @@ def test_load_yaml_dict(expected_data: Any) -> None:
|
||||
@pytest.mark.usefixtures("try_both_loaders", "mock_hass_config_yaml")
|
||||
def test_load_yaml_dict_fail() -> None:
|
||||
"""Test item without a key."""
|
||||
# Make sure we raise a subclass of HomeAssistantError, not
|
||||
# annotated_yaml.YAMLException
|
||||
assert issubclass(yaml_loader.YamlTypeError, HomeAssistantError)
|
||||
|
||||
with pytest.raises(yaml_loader.YamlTypeError):
|
||||
yaml_loader.load_yaml_dict(YAML_CONFIG_FILE)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user