Skip to content

test: add unit tests for run_demo_loop streaming, EOF, and empty-input paths#3542

Merged
seratch merged 1 commit into
openai:mainfrom
jluocsa:test/repl-coverage
Jun 4, 2026
Merged

test: add unit tests for run_demo_loop streaming, EOF, and empty-input paths#3542
seratch merged 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.

@seratch seratch changed the title Add tests for run_demo_loop streaming, EOF, and empty-input paths test: add unit tests for run_demo_loop streaming, EOF, and empty-input paths Jun 4, 2026
@seratch seratch enabled auto-merge (squash) June 4, 2026 07:28
@seratch seratch merged commit bf0d025 into openai:main Jun 4, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants