test: add unit test increasing coverage for cleanup.py#5793
Open
cheesebee123 wants to merge 2 commits into
Open
test: add unit test increasing coverage for cleanup.py#5793cheesebee123 wants to merge 2 commits into
cheesebee123 wants to merge 2 commits into
Conversation
Collaborator
|
Response from ADK Triaging Agent Hello @cheesebee123, thank you for creating this PR! It looks like the Could you please add the license header to This information will help reviewers to review your PR more efficiently. Thanks! |
Added copyright notice and licensing information.
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.
Problem:
The
close_runnersutility function located ingoogle.adk.cli.utils.cleanuplacked dedicated unit test coverage to ensure it properly handles and awaits the asynchronous close method on provided runner instances.Solution:
Added a new asynchronous unit test (
test_close_runners_calls_close) usingunittest.mock(MockandAsyncMock) to verify that whenclose_runnersis called, the close method of each runner in the list is successfully awaited exactly once.Testing Plan:
Unit Tests:
platform win32 -- Python 3.11.14, pytest-9.0.3, pluggy-1.6.0
rootdir: C:\Users\Dr. Puffyapple\Documents\Google_ADK_Unittests\adk-python
configfile: pyproject.toml
plugins: anyio-4.13.0, langsmith-0.8.4, asyncio-1.3.0, cov-7.1.0, mock-3.15.1, xdist-3.8.0
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function
collected 1 item `
tests\unittests\cli\utils\test_cleanup.py . [100%]
============================================================================== 1 passed in 3.37s ==============================================================================
Manual End-to-End (E2E) Tests:
Checklist
Additional context
Add any other context or screenshots about the feature request here.