adaptive-lighting/tests/conftest.py
Bas Nijholt f2a124c30f
Update Ruff to be used in tests (#943)
* Update Ruff config

* Rerun ruff
2024-03-03 15:09:18 -08:00

20 lines
747 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):
return