1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Bump ruff to 0.3.4 (#112690)

Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Joost Lekkerkerker
2024-03-26 00:02:16 +01:00
committed by GitHub
parent 27219b6962
commit 6bb4e7d62c
1044 changed files with 24245 additions and 16750 deletions

View File

@@ -121,10 +121,14 @@ async def test_integrationt_requirement_not_found(hass: HomeAssistant) -> None:
"""Test errors if integration with a requirement not found not found."""
# Make sure they don't exist
files = {YAML_CONFIG_FILE: BASE_CONFIG + "test_custom_component:"}
with patch(
"homeassistant.helpers.check_config.async_get_integration_with_requirements",
side_effect=RequirementsNotFound("test_custom_component", ["any"]),
), patch("os.path.isfile", return_value=True), patch_yaml_files(files):
with (
patch(
"homeassistant.helpers.check_config.async_get_integration_with_requirements",
side_effect=RequirementsNotFound("test_custom_component", ["any"]),
),
patch("os.path.isfile", return_value=True),
patch_yaml_files(files),
):
res = await async_check_ha_config_file(hass)
log_ha_config(res)
@@ -170,10 +174,14 @@ async def test_integration_import_error(hass: HomeAssistant) -> None:
"""Test errors if integration with a requirement not found not found."""
# Make sure they don't exist
files = {YAML_CONFIG_FILE: BASE_CONFIG + "light:"}
with patch(
"homeassistant.loader.Integration.async_get_component",
side_effect=ImportError("blablabla"),
), patch("os.path.isfile", return_value=True), patch_yaml_files(files):
with (
patch(
"homeassistant.loader.Integration.async_get_component",
side_effect=ImportError("blablabla"),
),
patch("os.path.isfile", return_value=True),
patch_yaml_files(files),
):
res = await async_check_ha_config_file(hass)
log_ha_config(res)
@@ -336,10 +344,14 @@ async def test_config_platform_import_error(hass: HomeAssistant) -> None:
"""Test errors if config platform fails to import."""
# Make sure they don't exist
files = {YAML_CONFIG_FILE: BASE_CONFIG + "light:\n platform: beer"}
with patch(
"homeassistant.loader.Integration.async_get_platform",
side_effect=ImportError("blablabla"),
), patch("os.path.isfile", return_value=True), patch_yaml_files(files):
with (
patch(
"homeassistant.loader.Integration.async_get_platform",
side_effect=ImportError("blablabla"),
),
patch("os.path.isfile", return_value=True),
patch_yaml_files(files),
):
res = await async_check_ha_config_file(hass)
log_ha_config(res)
@@ -356,10 +368,14 @@ async def test_platform_import_error(hass: HomeAssistant) -> None:
"""Test errors if platform not found."""
# Make sure they don't exist
files = {YAML_CONFIG_FILE: BASE_CONFIG + "light:\n platform: demo"}
with patch(
"homeassistant.loader.Integration.async_get_platform",
side_effect=[None, ImportError("blablabla")],
), patch("os.path.isfile", return_value=True), patch_yaml_files(files):
with (
patch(
"homeassistant.loader.Integration.async_get_platform",
side_effect=[None, ImportError("blablabla")],
),
patch("os.path.isfile", return_value=True),
patch_yaml_files(files),
):
res = await async_check_ha_config_file(hass)
log_ha_config(res)