chore(tests): remove Langfuse from all preprocessor tests

I test del preprocessor sono deterministici — nessun LLM coinvolto,
nessuno score da tracciare.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Roberto Musso
2026-04-07 14:26:33 +02:00
parent c0619f5c4d
commit d91c98f86d

View File

@@ -15,7 +15,6 @@ from pathlib import Path
import pytest
import yaml
from app.core.langfuse_client import get_langfuse
from app.core.preprocessors import detect_content_type, preprocess
_DEFAULT_DIR = Path(__file__).parent / "fixtures" / "preprocessors"
@@ -40,14 +39,6 @@ def _content(case: dict, data_dir: Path) -> str:
return (data_dir / case["file"]).read_text(encoding="utf-8")
def _lf_score(name: str, value: float) -> None:
lf = get_langfuse()
if lf:
trace = lf.trace(name=f"eval-{name}")
lf.score(trace_id=trace.id, name=name, value=value, data_type="NUMERIC")
lf.flush()
# ── parametrize at collection time via pytest hook ────────────────────
def pytest_generate_tests(metafunc):
@@ -71,7 +62,6 @@ def test_detect(preprocess_case, pytestconfig) -> None:
filename = case.get("file", "")
ct = detect_content_type(filename, raw)
expected = case["detect"]
_lf_score(f"preprocess.detect.{case['id']}", 1.0 if ct == expected else 0.0)
assert ct == expected, f"[{case['id']}] expected {expected!r}, got {ct!r}"