-
Notifications
You must be signed in to change notification settings - Fork 236
test: consolidate test utilities and improve test structure #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
150e6ab
to
b77a1e9
Compare
- Extract common test doubles into tests/test_doubles.py - Create builders module for test data construction - Add fixtures module for shared test fixtures - Refactor task manager tests to use shared utilities - Add __init__.py for proper test package structure
b77a1e9
to
d2d09b8
Compare
@gemini-code-assist review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request does a great job of consolidating test utilities into shared modules like builders
, fixtures
, and test_doubles
. This significantly improves the structure and readability of the tests for TaskManager
. The use of the builder pattern and dedicated test doubles with assertion helpers is a solid approach.
My feedback focuses on a few areas to further improve the code quality:
- Using more specific type hints in the new builder classes.
- Adhering to best practices for Python imports by avoiding
sys.path
manipulation and wildcard imports. - Restoring docstrings in the refactored tests to maintain documentation quality.
…GetTaskRequest" (a2aproject#428) Commit: a2aproject/A2A@e6b8c65 --------- Co-authored-by: Holt Skinner <[email protected]>
e691ade
to
8a6d1c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahoblitz Thanks for these updates, can you update the PR message to clarify what benefits these changes bring? (Efficiency, code quality, etc)
…test_task_manager.py
This should be there, let me know if you see any other changes! |
@gemini-code-assist review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request does an excellent job of consolidating test utilities into reusable builders and fixtures, which significantly improves the structure and readability of the tests. The introduction of test doubles with clear interfaces and assertion methods is a great addition. My review includes a few suggestions to enhance the robustness of the new builders and fixtures, primarily by addressing potential issues with mutable state in the builder pattern. These changes will help prevent subtle bugs in tests. Overall, this is a strong improvement to the project's testing infrastructure.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…into test/refactor-tests
Summary: This PR consolidates test utilities into reusable builders and fixtures, reducing code duplication. The refactored test structure improves test readability by using descriptive builder patterns.
Changes:
__init__.py
for proper test package structure