mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
* wip * refactor(tests): move sdk function tracing into rust python harness * dead code * fix: handle harness keyboard interrupts * refactor(tests): deduplicate rust python harness helpers * fix(harness): expose validated strategy choices * wip * refactor(harness): let strategies own parity reports * docs(harness): update strategy structure * refactor(harness): localize strategy report views * wip * fix(harness): satisfy mapping runner type checks * fix(harness): clarify trace parity output * wip * fix(harness): clarify unit mapping report * fix(harness): finalize trace parity contracts * refactor(harness): structure parity contracts * feat: derive unit test mapping from traces * feat(harness): map rstest test families * feat(ocr): port Azure document intelligence tests * feat(harness): enforce complete unit mappings * feat(ocr): add reducto core transforms * feat(harness): classify host-only unit tests * fix(ocr): complete Rust provider plumbing * fix(harness): reuse OCR parity workers
29 lines
872 B
Python
29 lines
872 B
Python
from __future__ import annotations
|
|
|
|
from collections.abc import Callable
|
|
from pathlib import Path
|
|
from typing import Final
|
|
|
|
import pytest
|
|
|
|
HARNESS_ROOT: Final = Path(__file__).resolve().parents[2]
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def subprocess_test_environment(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
monkeypatch.setenv("PYTHONPATH", str(HARNESS_ROOT))
|
|
monkeypatch.setenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", "1")
|
|
|
|
|
|
@pytest.fixture
|
|
def cargo_project(tmp_path: Path) -> Callable[[str, str], Path]:
|
|
def create(package: str, source: str) -> Path:
|
|
manifest: Final = tmp_path / "Cargo.toml"
|
|
manifest.write_text(
|
|
f'[package]\nname = "{package}"\nversion = "0.1.0"\nedition = "2021"\n[workspace]\n'
|
|
)
|
|
(tmp_path / "src").mkdir()
|
|
(tmp_path / "src/lib.rs").write_text(source)
|
|
return manifest
|
|
|
|
return create
|