mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-12 06:44:04 +02:00
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.6 → v0.2.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.6...v0.2.0) - [github.com/psf/black: 23.11.0 → 24.1.1](https://github.com/psf/black/compare/23.11.0...24.1.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
20 lines
746 B
Python
20 lines
746 B
Python
"""Fixtures for testing."""
|
|
|
|
import os
|
|
import sys
|
|
|
|
import pytest
|
|
|
|
# Tests in the dev enviromentment use the pytest_homeassistant_custom_component instead of
|
|
# a cloned HA core repo for a simple and clean structure. To still test against a HA core
|
|
# clone (e.g. the dev branch for which no pytest_homeassistant_custom_component exists
|
|
# because HA does not publish dev snapshot packages), set the HA_CLONE env variable.
|
|
if "HA_CLONE" in os.environ:
|
|
# Rewire the testing package to the cloned test modules. See the test `Dockerfile`
|
|
# for setup details.
|
|
sys.modules["pytest_homeassistant_custom_component"] = __import__("tests")
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def auto_enable_custom_integrations(enable_custom_integrations):
|
|
yield
|