From 9ec25ce7fd14925737c97015745897a5dbb0faf2 Mon Sep 17 00:00:00 2001 From: gensyn Date: Mon, 23 Nov 2026 10:57:59 +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..233bd15 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 diff --git a/tests/integration_tests/conftest.py b/tests/integration_tests/conftest.py index a48b25c..e9e6a84 100644 --- a/tests/integration_tests/conftest.py +++ b/tests/integration_tests/conftest.py @@ -1,4 +1,4 @@ -"""pytest-homeassistant-custom-component conftest for SSH Docker integration tests. +"""pytest-homeassistant conftest for SSH Docker 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 @@ -100,11 +100,6 @@ async def _default_ssh_run(hass, options, command, timeout=60): # --------------------------------------------------------------------------- -@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 sidebar panel registration — irrelevant for integration tests. diff --git a/tests/integration_tests/test_integration.py b/tests/integration_tests/test_integration.py index 57b8840..b685d01 100644 --- a/tests/integration_tests/test_integration.py +++ b/tests/integration_tests/test_integration.py @@ -1,6 +1,6 @@ """Integration tests for the SSH Docker 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. @@ -16,7 +16,7 @@ import pytest from homeassistant.core import HomeAssistant -from pytest_homeassistant_custom_component.common import MockConfigEntry +from pytest_homeassistant.common import MockConfigEntry from custom_components.ssh_docker.const import ( CONF_AUTO_UPDATE,