Repository navigation
Clean up test config after pytest-homeassistant migration - #889
Merged
Merged
Conversation
Follow-up to #888: - remove duplicate --asyncio-mode=auto from addopts (asyncio_mode is set in [tool:pytest]) - comment why -p no:respx is needed - filter two third-party import-time deprecation warnings (Home Assistant http server, backoff) - remove the commented-out pytest block from pyproject.toml - remove the auto_enable_custom_integrations fixture; the pytest-homeassistant hass fixture enables custom integrations by default - document uninstalling pytest-homeassistant-custom-component when upgrading a venv to Home Assistant 2026.11+ Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Follow-up to #888, which moved the tests from
pytest-homeassistant-custom-componenttopytest-homeassistant. These are small cleanups found while reviewing #888.Changes
setup.cfg--asyncio-mode=autofromaddopts. Migrate tests to pytest-homeassistant #888 addedasyncio_mode = autoto[tool:pytest], so the setting was in two places, and the command-line copy would silently win if they ever differed.-p no:respx. Home Assistant 2026.11 aliaseshttpxtohttpx2when it's imported, and raisesRuntimeError: httpx was already importedif something importshttpxfirst. respx's pytest plugin does that, so it has to stay disabled.filterwarningsentries for two deprecation warnings raised at import time by third-party code. Each entry is limited to its message and module, so other warnings (including any from pyscript) are still reported:homeassistant.components.http.server: aiohttp discourages subclassingweb.Applicationbackoff: usesasyncio.iscoroutinefunction, which is deprecated in Python 3.14pyproject.toml[tool.pytest.ini_options]block. The pytest config lives insetup.cfg.tests/conftest.pyauto_enable_custom_integrationsfixture. Inpytest-homeassistant, thehassfixture enables custom integrations by default (thecustom_integrations_enabledfixture returnsTrue).tests/README.mdvenv/bin/pip uninstall -y pytest-homeassistant-custom-component. Changing the pin inrequirements_test.txtdoesn't remove the old package, and its pytest plugin still loads automatically. On 2026.11 it fails at startup: it imports respx/httpx before Home Assistant (theRuntimeErrorabove), and its copy ofcommon.pyimports_clear_logger_overwrites, which 2026.11 removed.Testing
pytestwith Home Assistant 2026.11.0 andpytest-homeassistant2026.11.0: 180 passed, no warnings, both serial and with-n 8.🤖 Generated with Claude Code