ci: run pytest in CI; complete dev requirements; unblock socket test
The suite was never run in CI (only hassfest/HACS), and requirements-dev listed only pytest + smartthings-local while conftest.py needs the full Home Assistant test harness. - requirements-dev.txt: add pytest-homeassistant-custom-component (pulls in home-assistant + pytest + pytest-socket) and the integration's runtime deps (cbor2, pyOpenSSL, cryptography) needed to import it. - .github/workflows/validate.yml: add a Pytest job on Python 3.14 (current Home Assistant's floor) that installs requirements-dev and runs the suite. - test_config_flow.py: the UDP liveness-sweep test needs real loopback sockets, which the HA harness blocks by default; take the pytest-socket socket_enabled fixture so it runs instead of erroring. Full suite: 249 passed.
This commit is contained in:
3 files changed
+35
-2
No files matched your search
@@ -35,3 +35,23 @@ jobs:
|
||||
uses: hacs/action@main
|
||||
with:
|
||||
category: integration
|
||||
|
||||
tests:
|
||||
name: Pytest
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.14"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements-dev.txt
|
||||
|
||||
- name: Run tests
|
||||
run: pytest tests/ -q
|
||||
Reference in new issue
Block a user