Skip to content

test: unit tests for stdlib components (react, unit_test_eval) #817

@planetf1

Description

@planetf1

Add unit tests for stdlib components and frameworks with zero coverage.

Scope

File Stmts What's missing Est. tests
`stdlib/components/unit_test_eval.py` 71 JSON loading, Pydantic schema validation, `set_judge_context()` formatting — all pure logic, used by the eval CLI ~10
`stdlib/components/react.py` 33 `ReactInitiator` (goal + tool list formatting, finalizer injection), `ReactThought` — pure component logic ~5
`stdlib/frameworks/react.py` 39 Loop termination on `final_answer`, budget exhaustion, tool response collection — testable with mocked backend ~6

Notes

  • `unit_test_eval.py` is the easiest win — pure Pydantic + JSON, no LLM needed, used in production by `cli/eval/runner.py`
  • The react components are pure formatting logic, straightforward to test
  • `frameworks/react.py` needs a mocked `Backend.aact()` but the core loop logic (termination, budget, tool dispatch) is well-defined
  • Part of test: improve test coverage across formatters and core #813

~21 tests across the three files.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions