Skip to content

Commit abbe54d

Browse files
0xAHAclaude
andcommitted
ci: install integration requirements in the HA test job
Every tests_ha test failed at setup with reason='Import error'. The integration itself imported fine - config_flow.py did not, because it imports `serial` and `serial.tools.list_ports` at module level. pytest-homeassistant-custom-component does not install a custom integration's manifest.json requirements; Home Assistant does that itself at runtime. So the harness had no pymodbus or pyserial, and HA's platform loader reported the failure only as the opaque "Platform growatt_modbus.config_flow not found". The unit job already installed both explicitly. This matches it. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3a09d55 commit abbe54d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/tests.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ jobs:
4444
with:
4545
python-version: "3.13"
4646

47+
# pymodbus and pyserial are the integration's own manifest.json requirements.
48+
# Home Assistant installs those itself at runtime, but the test harness does not —
49+
# so without them config_flow.py fails at `import serial` and every test dies with
50+
# a bare "Import error" from HA's platform loader.
4751
- name: Install Home Assistant test harness
48-
run: pip install pytest-homeassistant-custom-component==0.13.316
52+
run: pip install pytest-homeassistant-custom-component==0.13.316 pymodbus pyserial
4953

5054
- name: Run tests
5155
run: pytest tests_ha/ -v

0 commit comments

Comments
 (0)