
Security News
The Nightmare Before Deployment
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.
pytest-homeassistant-custom-component
Advanced tools
Experimental package to automatically extract test plugins for Home Assistant custom components
Package to automatically extract testing plugins from Home Assistant for custom component testing. The goal is to provide the same functionality as the tests in home-assistant/core. pytest-homeassistant-custom-component is updated daily according to the latest homeassistant release including beta.
hassfrom tests.common import MockConfigEntryfrom pytest_homeassistant_custom_component.common import MockConfigEntrycustom_components folder, a custom_components/__init__.py file or changes to sys.path may be required.enable_custom_integrations fixture is required (versions >=2021.6.0b0)
recorder_mock, need to be initialized before enable_custom_integrations. See https://github.com/MatthewFlamm/pytest-homeassistant-custom-component/issues/132.asyncio_mode = auto config, see #129.load_fixture, the files need to be in a fixtures folder colocated with the tests. For example, a test in test_sensor.py can load data from some_data.json using load_fixture from this structure:tests/
fixtures/
some_data.json
test_sensor.py
snapshot fixture to conftest.py to make sure the snapshots are loaded from snapshot folder colocated with the tests. from pytest_homeassistant_custom_component.syrupy import HomeAssistantSnapshotExtension
from syrupy.assertion import SnapshotAssertion
@pytest.fixture
def snapshot(snapshot: SnapshotAssertion) -> SnapshotAssertion:
"""Return snapshot assertion fixture with the Home Assistant extension."""
return snapshot.use_extension(HomeAssistantSnapshotExtension)
simple_integration in this repository.This repository is set up to be nearly fully automatic.
ha_version, pytest_homeassistant_custom_component.const, and in the README above.pytest_homeassistant_custom_component files. CI testing will automatically generate the new files.This package was inspired by pytest-homeassistant by @boralyl, but is intended to more closely and automatically track the home-assistant/core library.
FAQs
Experimental package to automatically extract test plugins for Home Assistant custom components
We found that pytest-homeassistant-custom-component demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.

Research
/Security News
Impostor NuGet package Tracer.Fody.NLog typosquats Tracer.Fody and its author, using homoglyph tricks, and exfiltrates Stratis wallet JSON/passwords to a Russian IP address.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.