Add type hints to tests (#89497)

This commit is contained in:
epenet 2023-03-10 12:06:50 +01:00 committed by GitHub
parent b8bda93d87
commit a0f725dfcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 109 additions and 66 deletions

View file

@ -492,7 +492,9 @@ def test_representing_yaml_loaded_data(
@pytest.mark.parametrize("hass_config_yaml", ["key: thing1\nkey: thing2"])
def test_duplicate_key(caplog, try_both_loaders, mock_hass_config_yaml: None) -> None:
def test_duplicate_key(
caplog: pytest.LogCaptureFixture, try_both_loaders, mock_hass_config_yaml: None
) -> None:
"""Test duplicate dict keys."""
load_yaml_config_file(YAML_CONFIG_FILE)
assert "contains duplicate key" in caplog.text
@ -503,7 +505,7 @@ def test_duplicate_key(caplog, try_both_loaders, mock_hass_config_yaml: None) ->
[{YAML_CONFIG_FILE: "key: !secret a", yaml.SECRET_YAML: "a: 1\nb: !secret a"}],
)
def test_no_recursive_secrets(
caplog, try_both_loaders, mock_hass_config_yaml: None
caplog: pytest.LogCaptureFixture, try_both_loaders, mock_hass_config_yaml: None
) -> None:
"""Test that loading of secrets from the secrets file fails correctly."""
with pytest.raises(HomeAssistantError) as e: