mirror of
https://github.com/usestrix/strix.git
synced 2026-10-02 02:13:43 +00:00
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
24 lines
576 B
Python
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
|