mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-08-27 14:17:10 -04:00
test: isolate runtime environment overrides
This commit is contained in:
parent
bdb5eec38c
commit
8e793a8068
1 changed files with 9 additions and 0 deletions
|
|
@ -10,10 +10,19 @@ pytest.importorskip("fastapi")
|
|||
|
||||
from fastapi.testclient import TestClient # noqa: E402
|
||||
|
||||
from headroom.proxy import runtime_env # noqa: E402
|
||||
from headroom.proxy.loopback_guard import require_loopback # noqa: E402
|
||||
from headroom.proxy.server import ProxyConfig, create_app # noqa: E402
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _isolate_runtime_env_overrides():
|
||||
"""Keep loopback hot-reload state from leaking into later test modules."""
|
||||
runtime_env.clear_overrides()
|
||||
yield
|
||||
runtime_env.clear_overrides()
|
||||
|
||||
|
||||
def _make_client() -> TestClient:
|
||||
app = create_app(
|
||||
ProxyConfig(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue