From 21d6dfb6b967c1a601b96e92b46a3bc729690af1 Mon Sep 17 00:00:00 2001 From: gensyn Date: Mon, 23 Nov 2026 11:06:52 +0100 Subject: [PATCH] Migrated integration tests to pytest-homeassistant --- requirements_integration_tests.txt | 2 +- tests/integration_tests/conftest.py | 7 +------ tests/integration_tests/test_integration.py | 4 ++-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/requirements_integration_tests.txt b/requirements_integration_tests.txt index cbc546a..8827730 100644 --- a/requirements_integration_tests.txt +++ b/requirements_integration_tests.txt @@ -1 +1 @@ -pytest-homeassistant-custom-component==0.13.375 +pytest-homeassistant==2026.11.2 \ No newline at end of file diff --git a/tests/integration_tests/conftest.py b/tests/integration_tests/conftest.py index e3bb08d..c2339ac 100644 --- a/tests/integration_tests/conftest.py +++ b/tests/integration_tests/conftest.py @@ -1,4 +1,4 @@ -"""pytest-homeassistant-custom-component conftest for Task Tracker integration tests. +"""pytest-homeassistant conftest for Task Tracker integration tests. This file wires the component (which lives at the repo root, not inside a conventional ``custom_components/`` sub-directory) into Home Assistant's custom @@ -60,11 +60,6 @@ def expected_lingering_timers() -> bool: return True -@pytest.fixture(autouse=True) -def auto_enable_custom_integrations(enable_custom_integrations): - """Enable custom integrations for every test in this package.""" - - @pytest.fixture(autouse=True) def mock_frontend_setup(): """Skip lovelace / panel registration — irrelevant for integration tests. diff --git a/tests/integration_tests/test_integration.py b/tests/integration_tests/test_integration.py index 4955050..3cf1123 100644 --- a/tests/integration_tests/test_integration.py +++ b/tests/integration_tests/test_integration.py @@ -1,6 +1,6 @@ """Integration tests for the Task Tracker custom component. -These tests use ``pytest-homeassistant-custom-component`` which spins up a +These tests use ``pytest-homeassistant`` which spins up a real (in-process) Home Assistant instance per test. No hand-rolled mocks are needed: the ``hass`` fixture IS a real ``HomeAssistant`` object, and entities, states, and services all behave exactly as they do at runtime. @@ -17,7 +17,7 @@ from homeassistant.core import HomeAssistant from homeassistant.const import CONF_ICON from homeassistant.util import dt as dt_util -from pytest_homeassistant_custom_component.common import MockConfigEntry +from pytest_homeassistant.common import MockConfigEntry from custom_components.task_tracker.const import ( CONF_ACTIVE,