import sys
from pathlib import Path


sys.path.insert(0, str(Path(__file__).parents[1]))


import pytest

@pytest.fixture(autouse=True)
def isolated_approval_runtime(tmp_path, monkeypatch):
    import device_gateway.app as gateway
    from device_gateway.control.approvals import ApprovalRegistry
    monkeypatch.setenv("DEVICE_LAB_CONTROL_DIR", str(tmp_path / "private-runtime"))
    monkeypatch.setattr(gateway, "approvals", ApprovalRegistry())
