Enable Ruff rule PT007 (#113764)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Sid 2024-03-19 09:01:07 +01:00 committed by GitHub
parent 089a3ab6d7
commit 00ec7f11f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
204 changed files with 908 additions and 921 deletions

View file

@ -754,7 +754,7 @@ async def test_automation_stops(hass: HomeAssistant, calls, service) -> None:
assert len(calls) == (1 if service == "turn_off_no_stop" else 0)
@pytest.mark.parametrize("extra_config", ({}, {"id": "sun"}))
@pytest.mark.parametrize("extra_config", [{}, {"id": "sun"}])
async def test_reload_unchanged_does_not_stop(
hass: HomeAssistant, calls, extra_config
) -> None:
@ -962,7 +962,7 @@ async def test_reload_identical_automations_without_id(
@pytest.mark.parametrize(
"automation_config",
(
[
{
"trigger": {"platform": "event", "event_type": "test_event"},
"action": [{"service": "test.automation"}],
@ -1029,7 +1029,7 @@ async def test_reload_identical_automations_without_id(
},
},
},
),
],
)
async def test_reload_unchanged_automation(
hass: HomeAssistant, calls, automation_config
@ -1065,7 +1065,7 @@ async def test_reload_unchanged_automation(
assert len(calls) == 2
@pytest.mark.parametrize("extra_config", ({}, {"id": "sun"}))
@pytest.mark.parametrize("extra_config", [{}, {"id": "sun"}])
async def test_reload_automation_when_blueprint_changes(
hass: HomeAssistant, calls, extra_config
) -> None:
@ -1362,7 +1362,7 @@ async def test_automation_not_trigger_on_bootstrap(hass: HomeAssistant) -> None:
@pytest.mark.parametrize(
("broken_config", "problem", "details"),
(
[
(
{},
"could not be validated",
@ -1403,7 +1403,7 @@ async def test_automation_not_trigger_on_bootstrap(hass: HomeAssistant) -> None:
"failed to setup actions",
"Unknown entity registry entry abcdabcdabcdabcdabcdabcdabcdabcd.",
),
),
],
)
async def test_automation_bad_config_validation(
hass: HomeAssistant,
@ -2141,7 +2141,7 @@ async def test_blueprint_automation(hass: HomeAssistant, calls) -> None:
@pytest.mark.parametrize(
("blueprint_inputs", "problem", "details"),
(
[
(
# No input
{},
@ -2167,7 +2167,7 @@ async def test_blueprint_automation(hass: HomeAssistant, calls) -> None:
" data['action'][0]['service']"
),
),
),
],
)
async def test_blueprint_automation_bad_config(
hass: HomeAssistant,
@ -2350,21 +2350,21 @@ async def test_trigger_condition_explicit_id(hass: HomeAssistant, calls) -> None
@pytest.mark.parametrize(
("automation_mode", "automation_runs"),
(
[
(SCRIPT_MODE_PARALLEL, 2),
(SCRIPT_MODE_QUEUED, 2),
(SCRIPT_MODE_RESTART, 2),
(SCRIPT_MODE_SINGLE, 1),
),
],
)
@pytest.mark.parametrize(
("script_mode", "script_warning_msg"),
(
[
(SCRIPT_MODE_PARALLEL, "script1: Maximum number of runs exceeded"),
(SCRIPT_MODE_QUEUED, "script1: Disallowed recursion detected"),
(SCRIPT_MODE_RESTART, "script1: Disallowed recursion detected"),
(SCRIPT_MODE_SINGLE, "script1: Already running"),
),
],
)
@pytest.mark.parametrize("wait_for_stop_scripts_after_shutdown", [True])
async def test_recursive_automation_starting_script(