Skip to content

jpawlowski/haci-quality

v0.3.0MIT

Home Assistant testing knowledge: pytest-homeassistant patterns, fixtures, snapshots and the rules a test follows.

haci-testing

Write, fix, or extend automated tests for a Home Assistant custom integration using pytest and pytest-homeassistant. Use when asked to "add tests", "write a test", "the tests fail", "improve coverage", "add a regression test", "test the config flow", "update snapshots", or when a behavioural change needs verification before it can be called done. Covers when a test is required and where it sits, the shared fixtures, mocking the API client, config flow and entity test patterns, registry assertions, syrupy snapshots, freezing time, and Home Assistant's logged deprecations. SYMPTOMS — load this if you are about to: instantiate an entity class directly instead of asserting on hass.states; redefine a fixture pytest-homeassistant provides; use time.sleep instead of async_fire_time_changed; silence a DeprecationWarning to make the suite pass; or commit a snapshot you have not read.

Read SKILL.md at the source

Pinned to revision e25eb256b5eb, so it is the text this page describes rather than whatever the author pushed since.

Files

Every link opens the file at its source, pinned to the revision this page describes.