test: fix async generator mock for U3 streaming orchestrator #18
Loading…
Reference in New Issue
No description provided.
Delete Branch "fix/async-generator-mock-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
U3 streaming refactor switched orchestrator from
agent.execute()toagent.execute_stream()(async gen), but tests still mockedexecute().AsyncMock()returns a coroutine lacking__aiter__, causing:'async for' requires an object with __aiter__ method, got coroutineRuntimeWarning: coroutine was never awaitedChanges
Add shared helpers in
tests/unit/experts/_helpers.py:make_chat_stream_mock: async gen forgateway.chat_streammake_execute_stream_mock: async gen yieldingfinal_answereventmake_execute_stream_raising_mock: async gen that raises (for failure tests)Update 3 test files to use the helpers:
test_team_orchestrator.py:_make_mock_expert,_make_mock_pool, failure tests, assertion updates, synthesizer warning cleanuptest_pm_collaboration.py:_make_mock_expert,_make_mock_llm_gateway, collaboration/risk/rework assertionstest_board_orchestrator.py:_make_mock_gateway(warning cleanup)Verification
All 483
tests/unit/experts/tests pass with 0 warnings.