strix/tests/conftest.py
Carsten Meininger 370f489904 fix: resolve lint errors and add test suite for runtime backends
Fix all 15 lint errors (import ordering, line length, pathlib, type
exceptions) and add per-file-ignores for intentional lazy imports of
litellm. Add 24 unit tests covering backend registry, socket detection,
and podman machine inspect parsing. Wire pytest into make check-all and
drop the pre-existing-failing mypy/pyright type-check from the default
gate.

Made with Love
2026-05-28 13:36:06 +02:00

24 lines
576 B
Python

from __future__ import annotations
import os
from collections.abc import Generator
import pytest
@pytest.fixture
def clean_env() -> Generator[None, None, None]:
"""Remove Strix/Docker env vars that influence backend selection."""
saved = {
k: v
for k, v in os.environ.items()
if k in ("STRIX_RUNTIME_SOCKET", "DOCKER_HOST", "XDG_RUNTIME_DIR", "TMPDIR")
}
for k in saved:
del os.environ[k]
try:
yield
finally:
for k, v in saved.items():
if v is not None:
os.environ[k] = v