From ac3598f12af5468bd07dc178767f0393bc8c3a51 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 24 Jun 2025 18:07:58 +0200 Subject: [PATCH] cleanup --- tests/unit_tests/core/test_config.py | 1 - tests/unit_tests/test_entity.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/unit_tests/core/test_config.py b/tests/unit_tests/core/test_config.py index 55cc1f3027..ba8436b7a7 100644 --- a/tests/unit_tests/core/test_config.py +++ b/tests/unit_tests/core/test_config.py @@ -198,7 +198,6 @@ def test_device_with_invalid_area_id( # Check for the specific error message in stdout captured = capsys.readouterr() - print(captured.out) assert ( "Couldn't find ID 'nonexistent_area'. Please check you have defined an ID with that name in your configuration." in captured.out diff --git a/tests/unit_tests/test_entity.py b/tests/unit_tests/test_entity.py index 1b0c648be4..62ce7406ff 100644 --- a/tests/unit_tests/test_entity.py +++ b/tests/unit_tests/test_entity.py @@ -259,8 +259,7 @@ def extract_object_id_from_expressions(expressions: list[str]) -> str | None: for expr in expressions: # Look for set_object_id calls with regex to handle various formats # Matches: var.set_object_id("temperature_2") or var.set_object_id('temperature_2') - match = OBJECT_ID_PATTERN.search(expr) - if match: + if match := OBJECT_ID_PATTERN.search(expr): return match.group(1) return None