Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions agents/langgraph/react_agent/tests/behavioral/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import httpx
import pytest
import yaml
from harness.fixtures import load_golden as _load_golden_from
from harness.runner import TaskConfig, TaskResult, run_task

try:
Expand All @@ -39,6 +40,14 @@ def _find_repo_root() -> Path:
)


FIXTURES_DIR = Path(__file__).parent / "fixtures"


def load_golden(category: str | None = None) -> list[dict[str, Any]]:
"""Load golden queries from the fixtures directory, optionally filtering by category."""
return _load_golden_from(FIXTURES_DIR, category)


@pytest.fixture
def agent_url() -> str:
"""React agent URL from REACT_AGENT_URL env var or default localhost:8000."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
from __future__ import annotations

import warnings
from pathlib import Path
from typing import Any

import pytest
from harness.fixtures import load_golden as _load_golden_from
from conftest import load_golden
from harness.scorers.tool_sequence import (
score_hallucinated_tools,
score_tool_call_validity,
Expand All @@ -29,17 +28,10 @@

pytestmark = pytest.mark.langgraph_react

FIXTURES_DIR = Path(__file__).parent / "fixtures"


def _load_golden(category: str | None = None) -> list[dict[str, Any]]:
"""Load golden queries, optionally filtering by category."""
return _load_golden_from(FIXTURES_DIR, category)


def _factual_queries() -> list[dict[str, Any]]:
"""Return golden queries that should trigger tool calls."""
return [q for q in _load_golden() if q.get("expected_tools")]
return [q for q in load_golden() if q.get("expected_tools")]


@pytest.mark.parametrize(
Expand Down
Loading