test: add unit test increasing coverage for cleanup.py#5793
test: add unit test increasing coverage for cleanup.py#5793cheesebee123 wants to merge 6 commits into
Conversation
|
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.
|
Hi @cheesebee123 , Thank you for your contribution! We appreciate you taking the time to submit this pull request. Please fix formatting errors by running autoformat.sh |
116b653 to
2915993
Compare
|
Hi @wyf7107 , can you please review this. |
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.