Repository navigation
vNext: Run the test suite on Home Assistant 2026.11 with pytest-homeassistant - #578
Merged
Merged
Conversation
pytest-homeassistant-custom-component stopped at Home Assistant 2026.10.4 and is now deprecated upstream. The suite was pinned to 2026.10, below the 2026.11 floor of the component, so the climate entity, which uses the native temperature members of 2026.11, could not be tested through Home Assistant. Replace it with pytest-homeassistant 2026.11.1, which home-assistant/core publishes from packages/pytest-homeassistant, one release per Home Assistant release. - Import MockConfigEntry from pytest_homeassistant.common. - Switch off the respx pytest plugin, as the package README asks. - Ignore two import-time DeprecationWarnings from code outside this repo: aiohttp on the HomeAssistantApplication subclass, and asyncio.iscoroutinefunction in the backoff package. - Drop the enable_custom_integrations fixture: the new hass fixture loads custom integrations by default. - Update the comments and docs that named the old plugin. 390 passed on Python 3.14 with Home Assistant 2026.11.1.
The devcontainer installs Home Assistant core from the dev branch, then requirements_dev.txt on top. Its exact pins clashed with what that core pins, and the old test plugin pinned homeassistant==2026.10.0, so the install broke after a core update. - requirements_dev.txt lists the tools and libraries with no pins, so they follow the core in the devcontainer. It keeps --upgrade. - The devcontainer installs pytest-homeassistant from .ha-core/packages/pytest-homeassistant. That copy has no Home Assistant pin. The copy on PyPI pins one release and would replace the core. - New requirements_test.txt adds the exact pins (pytest-homeassistant 2026.11.1 and Ruff 0.17.0) on top of requirements_dev.txt. CI and plain runs outside the devcontainer install it, so each run tests the same versions. 390 passed on Python 3.14 with pip install -r requirements_test.txt.
p-monteiro
reviewed
Nov 15, 2026
| echo "==> Installing pytest-homeassistant from the Home Assistant core checkout" | ||
| # The copy on PyPI pins one Home Assistant release and would replace the | ||
| # core installed above. This copy has no pin, so it matches that core. | ||
| python -m pip install --editable "$HA_SRC_DIR/packages/pytest-homeassistant" |
Contributor
There was a problem hiding this comment.
Move this to setup-ha-core.sh so that the Task also installs it when called separately.
Owner
Author
There was a problem hiding this comment.
Moved to setup-ha-core.sh, right after the core install, so the Update task installs it too (2dfd222).
Owner
Author
There was a problem hiding this comment.
Same flags as the core install now: --upgrade --no-cache-dir and editable_mode=compat (9065caa). Could you rebuild the devcontainer once to confirm?
The task that updates Home Assistant to the latest dev branch runs setup-ha-core.sh on its own. With the plugin installed there, right after the core, that task keeps the two in step too.
Use --upgrade, --no-cache-dir and editable_mode=compat, as the core install above it does.
Twintop
added a commit
to Twintop/HomeAssistant-GreeClimateComponent
that referenced
this pull request
Nov 15, 2026
A target that was stored in the other unit is converted with TemperatureConverter and UNITS_GREE_TO_HA, as in climate.py and number.py, and then rounded to the steps of the device. Every target in range gives the same result as before, in both directions. 5.0-dev tests on Home Assistant 2026.11 since RobHofmann#578, so the climate tests of the memory no longer skip.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The suite was pinned to Home Assistant 2026.10, while the component needs 2026.11 (
hacs.json). The reason:pytest-homeassistant-custom-componentnever shipped a 2026.11 build. It stopped at 2026.10.4, and its README now says it is deprecated and points topytest-homeassistant, which home-assistant/core publishes frompackages/pytest-homeassistant, one release per Home Assistant release.Since #570 the climate entity uses the native temperature members that came in 2026.11. So on the 2026.10 pin, no test could check the climate entity through Home Assistant. This PR moves the suite to 2026.11.1.
Changes
requirements_dev.txt:pytest-homeassistant-custom-component==0.13.371becomespytest-homeassistant==2026.11.1. The new package pins Home Assistant, pytest and pytest-asyncio.tests/config_flow/test_registry_lookup.py: importMockConfigEntryfrompytest_homeassistant.common.pytest.ini:addopts = -p no:respx, as the package README asks, so Home Assistant can install its httpx alias before respx is imported.filterwarningsignores for import-timeDeprecationWarnings from code outside this repo: aiohttp on theHomeAssistantApplicationsubclass, andasyncio.iscoroutinefunctionin thebackoffpackage (filtered on that module only). Without either one, the suite fails at import undererror.tests/config_flow/conftest.py: drop theenable_custom_integrationsfixture. The newhassfixture loads custom integrations by default (custom_integrations_enabledreturnsTrueand does the samehass.data.pop(loader.DATA_CUSTOM_COMPONENTS)).pytest.ini, bothconftest.pyfiles,docs/development.mdand therun-testsskill.Requirement files and the devcontainer
The devcontainer installs Home Assistant core from the
devbranch, thenrequirements_dev.txtwith--upgrade. The exact pins in that file clashed with what core pins, and the old plugin pinnedhomeassistant==2026.10.0, so the install broke after a core update.requirements_dev.txtnow lists the tools and libraries with no version pins.--upgradestays.setup-ha-core.shinstallspytest-homeassistantright after the core, so the "Update Home Assistant to latest dev branch" task does it too. It installs it as editable from.ha-core/packages/pytest-homeassistant. That copy depends onhomeassistantwith no version. The copy on PyPI pins one release and would replace the core.requirements_test.txtis-r requirements_dev.txtplus the exact pins:pytest-homeassistant==2026.11.1andruff==0.17.0(same aslint.yml). CI (validate.yaml) and plain runs outside the devcontainer install it, so every run tests the same versions.CONTRIBUTING.md,docs/development.mdand therun-testsskill point torequirements_test.txtfor plain runs.Because the tools are unpinned and
--upgradestays, the devcontainer gets the newest Ruff, pylint and mypy, which can be newer than the versions in CI.Testing
python:3.14-slim) afterpip install -r requirements_test.txt, the same install CI does: 390 passed, with Home Assistant 2026.11.1, pytest-homeassistant 2026.11.1 and Ruff 0.17.0.ruff checkandruff format --check: pass.Notes
tests/config_flow/test_setpoint_memory_climate.py, which skips below 2026.11. With this PR it will run.pytest_homeassistant_custom_componentneed the same one-line import change after this merges.async_setup_entryandasync_unload_entrystill returnbool. vNext: Run natively on Home Assistant 2026.11 #570 left that change for the pin bump; it is not in this PR, so the PR stays a test-only change.