Skip to content

Add tests for run_demo_loop streaming, EOF, and empty-input paths#3542

Open
jluocsa wants to merge 1 commit into
openai:mainfrom
jluocsa:test/repl-coverage
Open

Add tests for run_demo_loop streaming, EOF, and empty-input paths#3542
jluocsa wants to merge 1 commit into
openai:mainfrom
jluocsa:test/repl-coverage

Conversation

@jluocsa
Copy link
Copy Markdown
Contributor

@jluocsa jluocsa commented May 31, 2026

Summary

run_demo_loop in src/agents/repl.py was only 60% covered: the streaming branch, the EOFError/KeyboardInterrupt exit path, and the empty-input skip were never exercised. This adds focused tests that bring the module to 100% coverage without changing any runtime code.

Changes

  • tests/test_repl.py: added three tests covering
    • the streaming path (text deltas, tool_call_item, tool_call_output_item, and AgentUpdatedStreamEvent via a handoff),
    • graceful exit on EOFError,
    • skipping empty input lines.

Test plan

  • uv run pytest tests/test_repl.py passes (4 tests).
  • repl.py coverage goes from 60% to 100%.
  • make format, make lint, and make typecheck are clean.

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