$npx skillfedfor your agent

pytest-homeassistant-custom-component

Experimental package to automatically extract test plugins for Home Assistant custom components

With conditionsPyPI TestingReleased Aug 20269.4M downloads / moMIT licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pytest_homeassistant_custom_component-0.13.355-py3-none-any.whl
v0.13.355 · released 2026-08-08 · Python >=3.14 · 30 runtime deps: sqlalchemy, coverage, freezegun, license-expression, mock-open, pydantic, PyGithub, pipdeptree

Yes, if you are developing a Home Assistant custom component and want to follow the same testing patterns as core Home Assistant. The active daily maintenance and permissive MIT license make it practical. Be aware that the Python 3.14 requirement and large dependency tree may require careful environment management, and the alpha status means the API could shift with Home Assistant updates.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.14; custom_components folder structure and enable_custom_integrations fixture required for versions >=2021.6.0b0; asyncio_mode = auto config required in pytest
  • Active maintenance with releases within days.
  • Low install friction; however, requires Python 3.14 and a large dependency tree of 30 runtime dependencies including pytest, sqlalchemy, pydantic, and homeassistant, which may complicate environment setup.

License · maintenance · safety

MIT license (permissive) — MIT license (permissive) allows use in both open and closed projects with minimal restrictions.

last release 2026-08-08 (6 days) · last repo commit 2026-08-08 · 110 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 9,409,116 downloads/mo, #1,535 on PyPI

Verify before relying

pip install pytest-homeassistant-custom-component

from pytest_homeassistant_custom_component.common import MockConfigEntry
from homeassistant.core import HomeAssistant

async def test_setup(hass: HomeAssistant):
    entry = MockConfigEntry(domain='my_domain')
    entry.add_to_hass(hass)
  • Whether the Python 3.14 requirement reflects actual compatibility or is aspirational given Home Assistant's own support timeline
  • Performance impact of the large dependency footprint on CI/CD pipeline times
  • Stability guarantees for alpha-stage package given daily automatic updates
Same gist for agents: .md · .json

What it is and what it does

pytest-homeassistant-custom-component extracts testing fixtures and helper functions from Home Assistant's core test suite and packages them for use in custom component projects. It allows developers to write integration tests using the same pytest fixtures (like `hass`, `MockConfigEntry`) and patterns as the main Home Assistant repository, without needing to fork or copy test code.

The package is automatically regenerated daily to track Home Assistant releases, including beta versions. It provides fixtures for async testing, mocking, snapshots via syrupy, and other common testing scenarios. Developers import helpers from `pytest_homeassistant_custom_component.common` instead of `tests.common`, and the package handles the extraction and versioning so that custom components can stay in sync with the Home Assistant testing API.

Use it for

  • Write pytest-based unit and integration tests for a Home Assistant custom component using the same fixtures as core Home Assistant
  • Ensure custom component tests remain compatible with new Home Assistant releases by updating to the latest daily build
  • Mock Home Assistant entities, config entries, and services in custom component tests without duplicating core test utilities
  • Use snapshot testing via syrupy for custom component configuration or state validation aligned with Home Assistant conventions
  • Set up async test fixtures and mocking for MQTT, database, or API-based custom components

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you are developing a Home Assistant custom component and want to follow the same testing patterns as core Home Assistant.

The active daily maintenance and permissive MIT license make it practical. Be aware that the Python 3.14 requirement and large dependency tree may require careful environment management, and the alpha status means the API could shift with Home Assistant updates.

Install

pytest-homeassistant-custom-component on PyPI

Before you install

Active maintenance with releases within days. Low install friction; however, requires Python 3.14 and a large dependency tree of 30 runtime dependencies including pytest, sqlalchemy, pydantic, and homeassistant, which may complicate environment setup.

Requires Python 3.14; custom_components folder structure and enable_custom_integrations fixture required for versions >=2021.6.0b0; asyncio_mode = auto config required in pytest

License in practice

MIT license (permissive) allows use in both open and closed projects with minimal restrictions.

Quickstart

pip install pytest-homeassistant-custom-component

from pytest_homeassistant_custom_component.common import MockConfigEntry
from homeassistant.core import HomeAssistant

async def test_setup(hass: HomeAssistant):
    entry = MockConfigEntry(domain='my_domain')
    entry.add_to_hass(hass)

Verify before relying

  • Whether the Python 3.14 requirement reflects actual compatibility or is aspirational given Home Assistant's own support timeline
  • Performance impact of the large dependency footprint on CI/CD pipeline times
  • Stability guarantees for alpha-stage package given daily automatic updates

Package facts

LicenseMIT license permissive
Python supportCapped below the current Python release >=3.14
Install frictionLow. Pure-Python wheel
Runtime dependencies
30 packages
sqlalchemycoveragefreezegunlicense-expressionmock-openpydanticPyGithubpipdeptreepytest-asynciopytest-aiohttppytest-covpytest-freezerpytest-github-actions-annotate-failurespytest-socketpytest-timeoutpytest-unorderedpytest-pickedpytest-xdistpytestrequestsrequests-mockrespxsyrupytqdmunidiffhomeassistantaiohasupervisorSQLAlchemypaho-mqttnumpy
MaintenanceActively maintained 6 days since the last release
Last repo commit
First released
Downloads9,409,116 / month, #1,535 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 3 - AlphaFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3.14Topic :: Software Development :: Testing

Evidence: pytest_homeassistant_custom_component-0.13.355-py3-none-any.whl

Tags

Capabilities
home assistant custom component testingpytest fixtures for home assistanthome assistant integration testscustom component test utilitieshome assistant test helpers
Topics
home-assistantpytest-pluginintegration-testing

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “home assistant custom component testing”

Give your agent the search over MCP, or paste the wish link into any chat.

More Testing packages

pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
pytest Worth it
PyPI · Libraries · released Jun 2026

pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.

MITpure Python · 3.10+
1.1Bdownloads / mo
virtualenv Worth it
PyPI · Libraries · released Aug 2026

virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.

MITpure Python · 3.9+
532.9Mdownloads / mo
coverage Worth it
PyPI · Testing · released Aug 2026

Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.

Install it if you want to measure test completeness or enforce coverage thresholds in your project.

permissive licensepure Python · 3.10+
335.8Mdownloads / mo
pytest-asyncio Worth it
PyPI · Testing · released May 2026

pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.

Install it if you write tests for any asyncio-based code.

Apache-2.0pure Python · 3.10+
275.9Mdownloads / mo
pytest-json-ctrf Worth it
PyPI · Testing · released Jul 2026

A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.

Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.

MITpure Python · 3.8+
273.0Mdownloads / mo

See also adext · pytest-regressions · pytest-aiohttp · pytest-unused-fixtures · pytest-docker · homeassistant-stubs · pytest-rabbitmq · pytest-redis · pytest-deadfixtures · pytest-container