Skip to content

test(agents): use unittest assertions in example feature tests#141

Merged
tmgbedu merged 1 commit into
task/langgraph-agent-harnessfrom
task/agents-unittest-assertions
Jun 24, 2026
Merged

test(agents): use unittest assertions in example feature tests#141
tmgbedu merged 1 commit into
task/langgraph-agent-harnessfrom
task/agents-unittest-assertions

Conversation

@tmgbedu

@tmgbedu tmgbedu commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Converts the bare pytest-style assert statements in the example/agents feature tests to proper unittest assertion methods, matching the unittest.IsolatedAsyncioTestCase base they inherit (via tests.test_case.TestCaseHttpTestCasefastapi_startkit.testing.TestCase).

  • assert x == yself.assertEqual(x, y)
  • Async test methods left untouched
  • @ChatAgent.fake(...) / @ChatAgent.record(...) decorators left intact

Files

  • example/agents/tests/features/test_chat_controller.py
  • example/agents/tests/features/test_home_controller.py

Testing

Ran the feature suite against the example app scaffolding — all 3 tests pass:

tests/features/test_chat_controller.py::TestChatController::test_chat_responds_for_basic_greetings PASSED
tests/features/test_chat_controller.py::TestChatController::test_chat_responds_for_other_greetings PASSED
tests/features/test_home_controller.py::TestHomeController::test_home PASSED

Notes

Based on the task/langgraph-agent-harness branch (PR #139). The example app scaffolding and the other_greetings.json record fixture are part of that harness PR and are intentionally not included here — this PR only touches assertion style.

Convert bare assert statements to self.assertEqual in the example/agents
feature tests, matching the unittest.IsolatedAsyncioTestCase base. Keep the
async test methods and the @ChatAgent.fake / @ChatAgent.record decorators
intact.
@tmgbedu tmgbedu merged commit 229ce43 into task/langgraph-agent-harness Jun 24, 2026
1 of 3 checks passed
@tmgbedu tmgbedu deleted the task/agents-unittest-assertions branch June 28, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant