test: add comprehensive tests for task/ module#75
Open
koriyoshi2041 wants to merge 4 commits intoagentclientprotocol:mainfrom
Open
test: add comprehensive tests for task/ module#75koriyoshi2041 wants to merge 4 commits intoagentclientprotocol:mainfrom
koriyoshi2041 wants to merge 4 commits intoagentclientprotocol:mainfrom
Conversation
Cover the 4 previously-untested task/ submodules: - supervisor.py: lifecycle, error handling, shutdown, cancellation (8 tests) - state.py: outgoing future resolution/rejection, incoming records (9 tests) - queue.py: publish/consume FIFO, close semantics, join (6 tests) - dispatcher.py: request/notification routing, error propagation (5 tests) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Properly close the asyncio.sleep(0) coroutine that is never scheduled when supervisor.create() raises after shutdown. Eliminates RuntimeWarning about unawaited coroutine. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prefix the pytest.raises match pattern with r"..." to satisfy ruff RUF043 (regex metacharacters in non-raw string). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Convert supervisor and queue fixtures to pytest_asyncio fixtures that guarantee cleanup even when assertions fail mid-test. Add comment documenting private attribute access in dispatcher test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
task/moduleTaskSupervisor,InMemoryMessageStateStore,InMemoryMessageQueue, andDefaultMessageDispatchertask/module (up from 0%)Files Added
test_task_supervisor.pytest_task_state.pytest_task_queue.pytest_task_dispatcher.pyTest plan
pytest -v)ruff checkpasses (zero violations)ruff format --checkpassesRuntimeWarningabout unawaited coroutinesconftest.pyimports)store._incomingfor state verification🤖 Generated with Claude Code