diff --git a/pyproject.toml b/pyproject.toml index 7bb012d..d4a3626 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,6 @@ [tool.black] line-length = 109 -#[tool.pytest.ini_options] -#asyncio_mode = "auto" -#asyncio_default_fixture_loop_scope = "function" - [tool.ruff] target-version = "py313" line-length = 109 diff --git a/setup.cfg b/setup.cfg index 9d3fa2e..c6a3178 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,10 +20,14 @@ asyncio_default_fixture_loop_scope = function testpaths = tests norecursedirs = .git log_level=INFO +# -p no:respx lets Home Assistant install its httpx alias before respx is imported addopts = -p no:respx --strict-markers - --asyncio-mode=auto +# third-party deprecation warnings raised at import time; not fixable in pyscript +filterwarnings = + ignore:Inheritance class HomeAssistantApplication from web.Application is discouraged:DeprecationWarning:homeassistant\.components\.http\.server + ignore:'asyncio.iscoroutinefunction' is deprecated:DeprecationWarning:backoff\._.* [mypy] python_version = 3.14 diff --git a/tests/README.md b/tests/README.md index f2362d9..c7d8d44 100644 --- a/tests/README.md +++ b/tests/README.md @@ -19,6 +19,15 @@ python -m pip install -r tests/requirements_test.txt pre-commit install ``` +If you are upgrading an existing virtual environment to Home Assistant 2026.11 or later, you must +first uninstall the old `pytest-homeassistant-custom-component` package, which has been replaced by +`pytest-homeassistant`. Its pytest plugin still loads if it is installed, and it fails with +Home Assistant 2026.11+: +```bash +venv/bin/pip uninstall -y pytest-homeassistant-custom-component +python -m pip install -r tests/requirements_test.txt +``` + To submit PRs you will want to fork the repository, and follow the steps above on your forked repository. Once you have pushed your changes to the fork (which should run the pre-commit hooks), you can go ahead and submit a PR. diff --git a/tests/conftest.py b/tests/conftest.py index 3ef73c8..03e9717 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -20,13 +20,6 @@ from homeassistant.core import HomeAssistant from homeassistant.setup import async_setup_component - -@pytest.fixture(autouse=True) -def auto_enable_custom_integrations(enable_custom_integrations): - """Enable custom integrations in all tests.""" - yield - - _UNSET = object()