mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-10-29 22:47:46 +01:00
Deletes the YAML CONFIG_SCHEMA, async_setup import, async_step_import, the yaml_managed options abort, and the hass.config.entry_updated listener that was registered on every entry setup and never removed. A leftover YAML block now gets HA's standard config-entry-only warning. OpenSpec change remove-yaml-import archived (options-flow R7 removed). |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| conftest.py | ||
| README.md | ||
| test_adaptation_utils.py | ||
| test_color_and_brightness.py | ||
| test_config_flow.py | ||
| test_hass_utils.py | ||
| test_init.py | ||
| test_number_platform.py | ||
| test_sensor_platform.py | ||
Developer notes for the tests directory
The tests use pytest-homeassistant-custom-component
(PHCC), which bundles a pinned Home Assistant plus its test fixtures. No Home
Assistant core checkout is required (the old clone-core + symlink + Docker
flow has been retired).
Running the tests
From the repo root:
uv run pytest
uv builds the environment from pyproject.toml (the test dependency group
pulls in PHCC, pytest, and pytest-asyncio), and testpaths = ["tests"]
scopes collection to this directory. Pass pytest arguments straight through:
uv run pytest tests/test_number_platform.py -k ramp -vv
What CI runs
.github/workflows/pytest.yaml runs the same suite on two matrix entries:
- stable — the latest released PHCC (current stable HA).
- dev — the latest PHCC pre-release (
--pre, upcoming HA beta), markedcontinue-on-errorso a missing or flaky pre-release never fails the build.
To reproduce a CI entry in a throwaway environment:
PYTHONPATH="$PWD" uv run --no-project \
--with pytest-homeassistant-custom-component --with pytest \
--with pytest-asyncio --with ulid-transform \
pytest -q