"""Conftest for integration tests. Stubs out homeassistant and voluptuous so the component package can be imported without the full HA stack installed (integration group only needs caldav, icalendar, and pytest). """ import sys from pathlib import Path from unittest.mock import MagicMock sys.path.insert(0, str(Path(__file__).parents[1])) _HA_MODULES = [ "voluptuous", "homeassistant", "homeassistant.config_entries", "homeassistant.const", "homeassistant.core", "homeassistant.helpers", "homeassistant.helpers.aiohttp_client", "homeassistant.helpers.config_validation", "homeassistant.helpers.entity", "homeassistant.helpers.event", "homeassistant.helpers.storage", "homeassistant.helpers.update_coordinator", "homeassistant.util", "homeassistant.util.dt", "homeassistant.components", "homeassistant.components.sensor", ] for _mod in _HA_MODULES: if _mod not in sys.modules: sys.modules[_mod] = MagicMock()