From 304ed8bf3d70815d97d4432badbf83f126d320f1 Mon Sep 17 00:00:00 2001 From: Sid <27780930+autinerd@users.noreply.github.com> Date: Mon, 1 Apr 2024 21:28:54 +0200 Subject: [PATCH] Unignore Ruff PLC in tests (#114572) --- tests/components/deconz/test_alarm_control_panel.py | 8 ++++---- tests/components/rainbird/test_calendar.py | 2 +- tests/ruff.toml | 1 - tests/test_config.py | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/components/deconz/test_alarm_control_panel.py b/tests/components/deconz/test_alarm_control_panel.py index ec926491724..c855076de2f 100644 --- a/tests/components/deconz/test_alarm_control_panel.py +++ b/tests/components/deconz/test_alarm_control_panel.py @@ -171,11 +171,11 @@ async def test_alarm_control_panel( # Event signals alarm control panel arming - for arming_event in { + for arming_event in ( AncillaryControlPanel.ARMING_AWAY, AncillaryControlPanel.ARMING_NIGHT, AncillaryControlPanel.ARMING_STAY, - }: + ): event_changed_sensor = { "t": "event", "e": "changed", @@ -190,10 +190,10 @@ async def test_alarm_control_panel( # Event signals alarm control panel pending - for pending_event in { + for pending_event in ( AncillaryControlPanel.ENTRY_DELAY, AncillaryControlPanel.EXIT_DELAY, - }: + ): event_changed_sensor = { "t": "event", "e": "changed", diff --git a/tests/components/rainbird/test_calendar.py b/tests/components/rainbird/test_calendar.py index 6258ac56249..9f6dfd9213d 100644 --- a/tests/components/rainbird/test_calendar.py +++ b/tests/components/rainbird/test_calendar.py @@ -125,7 +125,7 @@ def get_events_fixture( ) assert response.status == HTTPStatus.OK results = await response.json() - return [{k: event[k] for k in {"summary", "start", "end"}} for event in results] + return [{k: event[k] for k in ("summary", "start", "end")} for event in results] return _fetch diff --git a/tests/ruff.toml b/tests/ruff.toml index b88a5f1689e..5455e211762 100644 --- a/tests/ruff.toml +++ b/tests/ruff.toml @@ -4,7 +4,6 @@ extend = "../pyproject.toml" [lint] extend-ignore = [ - "PLC", # pylint "B904", # Use raise from to specify exception cause "N815", # Variable {name} in class scope should not be mixedCase ] diff --git a/tests/test_config.py b/tests/test_config.py index 49cc2bb573f..89a9b7b7082 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -2042,12 +2042,12 @@ async def test_core_config_schema_legacy_template( await config_util.async_process_ha_core_config(hass, config) issue_registry = ir.async_get(hass) - for issue_id in {"legacy_templates_true", "legacy_templates_false"}: + for issue_id in ("legacy_templates_true", "legacy_templates_false"): issue = issue_registry.async_get_issue("homeassistant", issue_id) assert issue if issue_id == expected_issue else not issue await config_util.async_process_ha_core_config(hass, {}) - for issue_id in {"legacy_templates_true", "legacy_templates_false"}: + for issue_id in ("legacy_templates_true", "legacy_templates_false"): assert not issue_registry.async_get_issue("homeassistant", issue_id)