-
Notifications
You must be signed in to change notification settings - Fork 931
refactor(agents-api): Migrate to pytest from ward #1497
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: dev
Are you sure you want to change the base?
Conversation
Signed-off-by: Diwank Singh Tomer <diwank.singh@gmail.com>
Claude finished @creatorrr's task —— View job PR Review: Migrate to pytest from wardI've completed a comprehensive review of this pytest migration PR. This is a well-executed migration that significantly improves the testing infrastructure. ✅ Overall Assessment: APPROVEDThis is an excellent migration that modernizes the testing framework while maintaining test coverage and improving development experience. 🎯 Strengths1. Comprehensive Configuration
2. Well-Structured Fixture Migration
3. Test Pattern Consistency
4. Performance Improvements
🔧 Technical ExcellenceConfiguration Quality# Excellent async configuration
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
# Smart coverage and reporting
addopts = [
"--cov=agents_api",
"--testmon", # Only run tests affected by changes
"--tb=short", # Concise error reporting
] Fixture Design
|
CI Feedback 🧐(Feedback updated until commit 9cc9095)A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
Signed-off-by: Diwank Singh Tomer <diwank.singh@gmail.com>
Claude finished @creatorrr's task —— View job PR Review: Pytest Migration - CI Failures AnalysisI've analyzed the CI failures and identified specific fixes needed to resolve the blocking errors. Todo List:
🐛 Critical Issues FoundI've identified the root causes of the CI failures: 1. Pytype Decorator Analysis Issue (
|
Signed-off-by: Diwank Singh Tomer <diwank.singh@gmail.com>
Claude finished @creatorrr's task —— View job PR Review: Pytest Migration AnalysisI've conducted a comprehensive review of this pytest migration PR. Here's my analysis: Todo List:
✅ Overall Assessment: EXCELLENT with Minor Fixes NeededThis is a high-quality migration that significantly modernizes the testing infrastructure while maintaining comprehensive test coverage. The migration from Ward to pytest is well-executed with excellent attention to detail. 🎯 Code Quality & Best Practices: OUTSTANDINGPytest Configuration (pyproject.toml:115-145)
Fixture Migration (conftest.py:1-658)
Test File Migration Patterns
🐛 Critical Issues Found1. Variable Reference Error (test_chat_streaming.py:336)# ISSUE: test_session is undefined
assert call_args["session_id"] == test_session.id # ❌ Line 336
# SHOULD BE:
assert call_args["session_id"] == session.id # ✅ (session defined on line 324) 2. Pytype Decorator Analysis Issues (test_transitions_queries.py)Lines 94, 146, 292, 303, 358, 369 - Functions decorated with Root Cause: The 🚀 Performance Considerations: EXCELLENTSmart Test Execution
Resource Management
🔒 Security Assessment: GOODTest Isolation
Environment Handling
📊 Test Coverage: MAINTAINED
🔧 Technical ExcellenceAsync Patterns
Dependency Management
|
Claude finished @creatorrr's task —— View job Changelog Bot AnalysisAnalyzing the diff to determine if changelog entry is needed... Todo List:
Analysis CompleteChange Type: Internal development infrastructure migration (Ward → pytest testing framework) User Impact: None - This is purely a development tooling change that does not affect:
Decision: No changelog entry required as this introduces no user-visible changes. The migration updates:
Since this is an internal refactoring with no user-visible impact, no changelog entry will be created per the bot instructions. |
Claude finished @creatorrr's task —— View job PR Review: Pytest Migration AnalysisI've conducted a comprehensive review of this pytest migration PR. Here's my analysis: Todo List:
✅ Overall Assessment: EXCELLENT with Minor Fixes NeededThis is a high-quality migration that significantly modernizes the testing infrastructure while maintaining comprehensive test coverage. The migration from Ward to pytest is well-executed with excellent attention to detail. 🎯 Code Quality & Best Practices: OUTSTANDINGPytest Configuration (pyproject.toml:115-145)
Fixture Migration (conftest.py:1-658)
Test File Migration Patterns
🐛 Critical Issues Found1. Variable Reference Error (test_chat_streaming.py:336)# ISSUE: test_session is undefined
assert call_args["session_id"] == test_session.id # ❌ Line 336
# SHOULD BE:
assert call_args["session_id"] == session.id # ✅ (session defined on line 324) 2. Pytype Decorator Analysis Issues (test_transitions_queries.py)Lines 94, 146, 292, 303, 358, 369 - Functions decorated with Root Cause: The 🚀 Performance Considerations: EXCELLENTSmart Test Execution
Resource Management
🔒 Security Assessment: GOODTest Isolation
Environment Handling
📊 Test Coverage: MAINTAINED
🔧 Technical ExcellenceAsync Patterns
Dependency Management
|
Claude finished @creatorrr's task —— View job Changelog Bot AnalysisAnalyzing the diff to determine if changelog entry is needed... Todo List:
Analysis CompleteChange Type: Internal development infrastructure migration (Ward → pytest testing framework) User Impact: None - This is purely a development tooling change that does not affect:
Decision: No changelog entry required as this introduces no user-visible changes. The migration updates:
Since this is an internal refactoring with no user-visible impact, no changelog entry will be created per the bot instructions. |
Signed-off-by: Diwank Singh Tomer <diwank.singh@gmail.com>
730337c
to
60a6da9
Compare
Claude finished @creatorrr's task —— View job PR Review: Pytest Migration AnalysisI've conducted a comprehensive review of this pytest migration PR. Here's my analysis: Todo List:
✅ Overall Assessment: EXCELLENT MigrationThis is a high-quality migration that significantly modernizes the testing infrastructure while maintaining comprehensive test coverage. The migration from Ward to pytest is well-executed with excellent attention to detail. 🎯 Code Quality & Best Practices: OUTSTANDINGPytest Configuration (pyproject.toml:115-145)
Fixture Migration (conftest.py:1-685)
Test File Migration Patterns
🚀 Performance Considerations: EXCELLENTSmart Test Execution
Resource Management
🔒 Security Assessment: GOODTest Isolation
Environment Handling
📊 Test Coverage: MAINTAINED
🔧 Technical ExcellenceAsync Patterns
Dependency Management
✅ Issue ResolutionThe previously identified CI blocking issues have been resolved:
|
Claude finished @creatorrr's task —— View job Changelog Bot AnalysisAnalyzing the diff to determine if changelog entry is needed... Todo List:
Analysis CompleteChange Type: Internal development infrastructure migration (Ward → pytest testing framework) User Impact: None - This is purely a development tooling change that does not affect:
Decision: No changelog entry required as this introduces no user-visible changes. The migration updates:
Since this is an internal refactoring with no user-visible impact, no changelog entry will be created per the bot instructions. |
Claude finished @creatorrr's task —— View job PR Review: Pytest Migration AnalysisI've conducted a comprehensive review of this pytest migration PR. Here's my analysis: Todo List:
✅ Overall Assessment: EXCELLENT MigrationThis is a high-quality migration that significantly modernizes the testing infrastructure while maintaining comprehensive test coverage. The migration from Ward to pytest is well-executed with excellent attention to detail. 🎯 Code Quality & Best Practices: OUTSTANDINGPytest Configuration (pyproject.toml:115-145)
Fixture Migration (conftest.py:1-685)
Test File Migration Patterns
🚀 Performance Considerations: EXCELLENTSmart Test Execution
Resource Management
🔒 Security Assessment: GOODTest Isolation
Environment Handling
📊 Test Coverage: MAINTAINED
🔧 Technical ExcellenceAsync Patterns
Dependency Management
✅ Issue ResolutionThe previously identified CI blocking issues have been resolved:
|
Claude finished @creatorrr's task —— View job Changelog Bot AnalysisAnalyzing the diff to determine if changelog entry is needed... Todo List:
Analysis CompleteChange Type: Internal development infrastructure migration (Ward → pytest testing framework) User Impact: None - This is purely a development tooling change that does not affect:
Decision: No changelog entry required as this introduces no user-visible changes. The migration updates:
Since this is an internal refactoring with no user-visible impact, no changelog entry will be created per the bot instructions. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
@creatorrr tests are failing |
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.
Important
Looks good to me! 👍
Reviewed everything up to 9cc9095 in 5 minutes and 31 seconds. Click for details.
- Reviewed
16620
lines of code in65
files - Skipped
0
files when reviewing. - Skipped posting
38
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. agents-api/tests/test_base_evaluate.py:19
- Draft comment:
Good conversion from ward to pytest with added docstring. Consider adding explicit assertion messages in your raises blocks for clearer debugging. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
2. agents-api/tests/test_model_validation.py:4
- Draft comment:
Consider centralizing SAMPLE_MODELS into a shared fixture to ensure consistency across tests. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
3. agents-api/tests/utils.py:114
- Draft comment:
Worker shutdown logic now includes cancellation; consider adding logging for unexpected cancellation exceptions to aid debugging. - Reason this comment was not posted:
Confidence changes required:50%
<= threshold50%
None
4. agents-api/tests/test_docs_queries.py:305
- Draft comment:
EMBEDDING_SIZE is used to build sample_vector_str; ensure that EMBEDDING_SIZE is defined or imported. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
The comment is asking the author to ensure that EMBEDDING_SIZE is defined or imported. This falls under the category of asking the author to double-check or ensure something, which is against the rules. Therefore, this comment should be removed.
5. agents-api/tests/test_execution_queries.py:25
- Draft comment:
Good update: using 'pytest.raises' with exc.value is correct. Ensure all exception checks consistently use exc.value instead of exc.raised. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
The comment is purely informative and suggests ensuring consistency in exception checks. However, it doesn't provide a specific code suggestion or point out a potential issue. It also doesn't ask for a test to be written or a specific change to be made. Therefore, it violates the rule against making purely informative comments.
6. agents-api/tests/test_chat_routes.py:111
- Draft comment:
Good update switching to the 'test_developer' fixture for clarity in dependency injection. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
7. agents-api/tests/test_usage_cost.py:39
- Draft comment:
Using a fresh developer ID for usage cost tests is a good practice for test isolation. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
8. agents-api/uv.lock:77
- Draft comment:
Dependency updates here are extensive; please double-check that the new pytest-related packages remain compatible with the rest of the codebase. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
9. agents-api/tests/test_user_routes.py:2
- Draft comment:
User routes tests now uniformly use the test_project and test_user fixtures; consider adding concise docstrings to each test for clarity. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
10. agents-api/tests/test_transitions_queries.py:15
- Draft comment:
Consistently updating to use the test_developer_id fixture is good; verify that custom_scope_id is used correctly in all transition tests. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
11. agents-api/.pytest-runtimes:190
- Draft comment:
Typographical note: In the test name 'test_litellm_utils_acompletion_no_tools', the word 'acompletion' might be a typo. Consider verifying if it should be 'autocomplete' or another intended term. - Reason this comment was not posted:
Comment was on unchanged code.
12. agents-api/.pytest-runtimes:349
- Draft comment:
Typographical note: The test name 'test_construct_tool_call_works_with_tool_objects_not_just_createtoolrequest' contains 'createtoolrequest' as one word. Consider verifying if it should be separated (e.g., 'create_tool_request') for improved readability. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50% This is a new file that appears to be auto-generated containing test runtime data. The comment is suggesting a style change to a test name. However, test names are typically defined in the test files themselves, not in this runtime data file. Making style suggestions on an auto-generated file is not useful since the format is determined by the test names themselves. The proper place for such a comment would be on the actual test file where the test is defined. Maybe the test name format is actually important for some tooling or reporting purposes? Maybe there's a good reason it needs to be one word? Even if the test name format matters, this auto-generated file is not the right place to make that suggestion. The comment should be made on the source test file where the name is actually defined. Delete the comment because it's suggesting a style change on an auto-generated file rather than the source file where the test is actually defined.
13. agents-api/tests/test_agent_queries.py:21
- Draft comment:
There's an extraneous closing parenthesis on line 21. Please remove it if it isn’t intended. - Reason this comment was not posted:
Comment was on unchanged code.
14. agents-api/tests/test_agent_queries.py:35
- Draft comment:
The model value "gpt-4o-mini" on line 35 might contain a typographical error. If this wasn’t intentional, consider verifying whether it should be "gpt-4-mini". - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
15. agents-api/tests/test_chat_routes.py:345
- Draft comment:
There is a typographical/grammatical issue in the comment at this line. The phrase "a hybrid recall options to hybrid mode" is awkward. Perhaps consider rephrasing it to "Create a session with hybrid recall options in hybrid mode". - Reason this comment was not posted:
Comment was on unchanged code.
16. agents-api/tests/test_chat_routes.py:400
- Draft comment:
Typographical note: The comment on this line is a bit awkward. It currently reads "Update session to have a new recall options to text mode". Consider rewording it for clarity, e.g. "Update session with new recall options for text mode" or "Update session to use recall options in text mode." - Reason this comment was not posted:
Comment was on unchanged code.
17. agents-api/tests/test_chat_routes.py:449
- Draft comment:
There is a grammatical issue in the comment: "Update session to have a new recall options to vector mode". Consider removing the article "a" to read "Update session to have new recall options for vector mode". - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
This comment is purely informative and focuses on a grammatical issue in a comment, which is not relevant to the functionality or logic of the code. It does not provide a suggestion for code improvement or highlight a potential issue with the code itself.
18. agents-api/tests/test_chat_streaming.py:742
- Draft comment:
The function name 'test_chat_test_streaming_usage_tracking_with_different_models' appears to contain a duplicate 'test' and might be clearer as 'test_chat_streaming_usage_tracking_with_different_models'. Consider renaming it for clarity. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% While the comment points out a real naming issue, this seems to be a systematic pattern across all test functions in the file, likely due to an automated migration. The naming pattern, while not ideal, is consistent throughout the file. Making this change would require changing all test functions, not just this one. This feels more like a global refactoring decision than a PR-specific issue. The comment identifies a real code quality issue. Consistent and clear naming is important for maintainability. However, this appears to be a systematic pattern from a test framework migration. Addressing it for a single function would create inconsistency. This should be handled as a separate refactoring effort. The comment should be deleted. While it points out a real issue, fixing it for just one function would create inconsistency. This should be addressed as a separate refactoring effort across all test functions.
19. agents-api/tests/test_entry_queries.py:18
- Draft comment:
There's a stray closing parenthesis on this line (line 18). It doesn't appear to serve any purpose and should be removed to avoid confusion. - Reason this comment was not posted:
Comment was on unchanged code.
20. agents-api/tests/test_entry_queries.py:32
- Draft comment:
It looks like the call to CreateEntryRequest.from_model_input is missing a closing parenthesis. Please add it to ensure the syntax is correct. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
21. agents-api/tests/test_execution_workflow.py:27
- Draft comment:
Typo: Consider replacing informal 'coz' with 'because' for clarity in the comment. - Reason this comment was not posted:
Comment was on unchanged code.
22. agents-api/tests/test_execution_workflow.py:150
- Draft comment:
Typographical note: Consider replacing the informal 'coz' in the comment with 'because' to improve clarity. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =20%
<= threshold50%
This comment is about a typographical suggestion in a comment, which is not directly related to the functionality or correctness of the code. It is more of a stylistic suggestion and does not impact the code's behavior.
23. agents-api/tests/test_execution_workflow.py:249
- Draft comment:
The comment uses the informal abbreviation 'coz'. Consider replacing it with 'because' for improved clarity. - Reason this comment was not posted:
Comment was on unchanged code.
24. agents-api/tests/test_execution_workflow.py:445
- Draft comment:
Typographical: Consider replacing 'coz' with 'because' in the comment for clarity. - Reason this comment was not posted:
Comment was on unchanged code.
25. agents-api/tests/test_execution_workflow.py:506
- Draft comment:
Typographical note: Consider replacing the informal contraction 'coz' with 'because' in the comment. - Reason this comment was not posted:
Comment was on unchanged code.
26. agents-api/tests/test_execution_workflow.py:566
- Draft comment:
The inline comment uses the informal abbreviation 'coz'. Consider replacing it with 'because' for clarity and professionalism. - Reason this comment was not posted:
Comment was on unchanged code.
27. agents-api/tests/test_execution_workflow.py:638
- Draft comment:
Typographical note: Consider replacing "coz" with "because" for improved clarity in the comment. - Reason this comment was not posted:
Comment was on unchanged code.
28. agents-api/tests/test_execution_workflow.py:692
- Draft comment:
The inline comment uses the colloquial abbreviation 'coz'. Consider using 'because' for clarity and formality. - Reason this comment was not posted:
Comment was on unchanged code.
29. agents-api/tests/test_execution_workflow.py:751
- Draft comment:
Consider replacing 'coz' with 'because' to improve formality and clarity in the inline comment. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% While technically correct that 'because' is more formal than 'coz', this is a very minor stylistic suggestion in test code comments. The existing comment is clear and understandable. The change would not meaningfully improve code quality or functionality. Test code often uses more informal language in comments. The comment does point out a real informality in the code. Some organizations might have style guides that mandate formal language in all comments. Even if some organizations prefer formal language, this level of nitpicking on test code comments doesn't provide enough value to justify a PR comment. The informal language doesn't impact understanding. Delete the comment as it suggests a trivial stylistic change that doesn't meaningfully improve the code.
30. agents-api/tests/test_execution_workflow.py:880
- Draft comment:
Typographical note: The inline comment uses 'coz' as an abbreviation for 'because'. Consider changing it to 'because' for clarity. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% This is a very minor stylistic suggestion about an informal abbreviation in a test file comment. The current comment is clear enough - developers commonly use informal language in comments. The change wouldn't affect functionality or significantly improve readability. The comment appears in many test functions, so changing it would require multiple edits for minimal benefit. The comment does point out inconsistent style in documentation. Professional codebases sometimes prefer formal language in comments for maintainability. While formal language can be good, this is a minor stylistic issue in test file comments that doesn't impact understanding. The informal style is common in test files and the meaning is clear. Delete the comment - it suggests a trivial stylistic change to clear test comments that doesn't meaningfully improve the code.
31. agents-api/tests/test_execution_workflow.py:928
- Draft comment:
There's an informal abbreviation in the comment on s3_client. Consider replacing "coz" with "because" for clarity. - Reason this comment was not posted:
Comment was on unchanged code.
32. agents-api/tests/test_execution_workflow.py:1032
- Draft comment:
Typo: consider replacing "coz" with "because" in the comment for clarity. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% This is a very minor stylistic suggestion about comment wording. While "because" is more formal than "coz", this is a test file and the abbreviated form doesn't impact code functionality or readability significantly. The comment is clear enough as is. Making this change would not meaningfully improve the code. The comment does point out a real informal usage in the code. Some could argue that maintaining professional language even in comments is important for code quality. While professional language is good, this level of nitpicking on test file comments doesn't provide enough value to justify a review comment. The meaning is perfectly clear either way. This comment should be deleted as it suggests an extremely minor stylistic change that doesn't meaningfully improve the code.
33. agents-api/tests/test_prepare_for_step.py:212
- Draft comment:
Typo: The workflow string contains an unexpected backtick (`) before 'main'. This is likely unintended and should be removed or corrected. - Reason this comment was not posted:
Comment was on unchanged code.
34. agents-api/tests/test_task_execution_workflow.py:1272
- Draft comment:
It looks like the function name contains a repeated word ('evaluate_evaluate'). Please confirm if this is intentional or if one 'evaluate' should be removed. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50% The repeated word 'evaluate' in the function name appears to be intentional because: 1. One 'evaluate' refers to the workflow's evaluation action 2. The second 'evaluate' refers to the type of expressions being evaluated (evaluate expressions) 3. This naming pattern is consistent with other test functions in the file that test expression evaluation The comment assumes the repetition is a mistake without considering the context. The function name could be clearer but it's technically correct. While the name could potentially be clearer, the repetition serves a purpose in describing both the action and the type of expression being tested. The current name is consistent with the codebase's conventions. The comment should be deleted because the repeated word is intentional and follows the codebase's naming pattern for test functions.
35. agents-api/tests/test_task_validation.py:43
- Draft comment:
Typographical issue: The assert statement on this line appears incomplete (i.e., it starts with 'assert (' but doesn't provide a complete condition or message). Please either complete or remove it. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
36. agents-api/tests/test_usage_cost.py:86
- Draft comment:
Typographical note: In the comment on line 86, the term "litellm" might be a typo. Please double-check that this is the intended spelling. - Reason this comment was not posted:
Comment looked like it was already resolved.
37. agents-api/tests/test_usage_tracking.py:15
- Draft comment:
There's a stray closing parenthesis on line 15. It doesn't seem to belong here and should be removed. - Reason this comment was not posted:
Comment was on unchanged code.
38. agents-api/tests/test_user_queries.py:26
- Draft comment:
There's a stray closing parenthesis)
on this line that seems unintentional. Consider removing it. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_9KAIGBJY4KrU1GwY
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
User description
Signed-off-by: Diwank Singh Tomer diwank.singh@gmail.com
PR Type
Tests
Description
• Migrated entire test suite from Ward testing framework to pytest
• Converted all
@test()
decorators to standard pytest function naming conventions (test_*
)• Updated exception handling from
ward.raises
topytest.raises
with proper attribute access patterns• Replaced Ward fixtures with pytest fixtures in
conftest.py
with proper scoping• Updated test runner configuration in
poe_tasks.toml
to use pytest instead of Ward• Added
@pytest.mark.skip()
decorators for tests requiring implementation or investigation• Removed Ward-specific imports and fixture parameter injection patterns
• Minor code refactoring in task execution helpers for better readability
Changes walkthrough 📝
20 files
test_execution_workflow.py
Migrate execution workflow tests from ward to pytest
agents-api/tests/test_execution_workflow.py
• Replaced
ward
imports withpytest
imports and decorators• Converted
@test()
decorators to standard pytest function names withtest_
prefix• Changed
@skip()
to@pytest.mark.skip()
with reason parameter•
Updated function parameters to use fixture names directly instead of
ward-style parameter injection
• Replaced
raises()
context managerwith
pytest.raises()
• Converted parameterized tests from ward's
loop-based approach to separate pytest functions
test_docs_queries.py
Migrate document query tests from ward to pytest
agents-api/tests/test_docs_queries.py
• Replaced
ward
imports withpytest
imports• Converted
@test()
decorators to standard pytest function names
• Changed
raises()
topytest.raises()
and updated exception access frome.raised
toe.value
• Removed ward-style fixture imports and updated to use pytest
fixtures
• Added utility import for
make_vector_with_similarity
test_chat_streaming.py
Migrate chat streaming tests from ward to pytest
agents-api/tests/test_chat_streaming.py
• Replaced
ward
imports withpytest
imports• Converted
@test()
decorators to standard pytest function names
• Changed
@skip()
to@pytest.mark.skip()
with reason parameter• Updated function
parameters to use fixture names directly
• Removed ward-style fixture
imports
test_middleware.py
Migrate middleware tests from ward to pytest
agents-api/tests/test_middleware.py
• Replaced
ward
imports withpytest
imports and decorators• Converted
@fixture
to@pytest.fixture
• Changed
@test()
decorators to standardpytest function names
• Updated function parameters to use pytest
fixture injection
• Added
@pytest.mark.skip()
for problematic testwith database pool issues
test_base_evaluate.py
Migrate base evaluate tests from ward to pytest
agents-api/tests/test_base_evaluate.py
• Replaced
ward
imports withpytest
imports• Converted
@test()
decorators to standard pytest function names with descriptive
docstrings
• Changed
raises()
topytest.raises()
context manager•
Updated test function signatures to remove ward-style parameter
injection
test_files_queries.py
Migrate file query tests from Ward to pytest
agents-api/tests/test_files_queries.py
• Replaced Ward test framework with pytest, changing
@test
decoratorsto
async def test_*
functions• Updated import statements to use
pytest
instead ofward
• Changed exception handling from
ward.raises
to
pytest.raises
with updated assertion syntax• Modified fixture
parameter names to use pytest naming conventions (e.g.,
dsn=pg_dsn
topg_dsn
)test_messages_truncation.py
Convert message truncation tests to pytest with skip markers
agents-api/tests/test_messages_truncation.py
• Added pytest import and converted commented Ward tests to pytest
format
• Added
@pytest.mark.skip
decorators to all test functions withreason "Truncation not yet implemented"
• Updated import statements to
use pytest conventions
• Converted test structure from Ward's
@test
decorators to pytest function definitions
test_docs_routes.py
Migrate document route tests from Ward to pytest
agents-api/tests/test_docs_routes.py
• Migrated all route tests from Ward to pytest framework
• Removed
Ward-specific imports and decorators, replacing with pytest function
definitions
• Simplified test functions by removing Ward's fixture
parameter syntax
• Consolidated test logic and removed redundant code
blocks
test_user_queries.py
Convert user query tests from Ward to pytest
agents-api/tests/test_user_queries.py
• Replaced Ward test framework with pytest, updating all test function
signatures
• Changed exception handling from
ward.raises
topytest.raises
with proper assertion syntax• Updated import statements
to remove Ward dependencies and add pytest
• Modified fixture
parameter usage to match pytest conventions
conftest.py
Add pytest configuration with migrated fixtures from Ward
agents-api/tests/conftest.py
• Created comprehensive pytest configuration file with all test
fixtures
• Migrated all Ward fixtures to pytest equivalents with
proper scoping
• Added session-scoped and function-scoped fixtures for
database, clients, and test data
• Implemented LocalStack container
fixture for S3 testing and proper cleanup mechanisms
test_session_queries.py
Migrate session query tests from Ward to pytest
agents-api/tests/test_session_queries.py
• Converted Ward test decorators to pytest function definitions
•
Updated exception handling from
ward.raises
topytest.raises
•
Modified fixture parameter syntax to match pytest conventions
• Added
pytest import and removed Ward-specific imports
test_task_queries.py
Migrate task query tests from ward to pytest
agents-api/tests/test_task_queries.py
• Replaced
ward
test framework imports and decorators withpytest
•
Changed test function signatures from
@test
decorators to standardasync def test_*
functions• Updated exception handling from
ward.raises
topytest.raises
with different attribute access patterns• Modified fixture parameter names to match pytest conventions (e.g.,
dsn=pg_dsn
topg_dsn
)test_agent_queries.py
Migrate agent query tests from ward to pytest
agents-api/tests/test_agent_queries.py
• Replaced
ward
test framework withpytest
imports and decorators•
Converted test functions from
@test
decorator pattern to standardpytest function naming
• Updated exception handling from
ward.raises
to
pytest.raises
with.value
attribute access• Changed fixture
parameter passing from ward-style to pytest-style parameter injection
test_execution_queries.py
Migrate execution query tests from ward to pytest
agents-api/tests/test_execution_queries.py
• Migrated from
ward
topytest
test framework with updated imports anddecorators
• Changed test function definitions from
@test
decoratedfunctions to standard pytest naming convention
• Updated exception
handling from
ward.raises
topytest.raises
with proper attributeaccess
• Removed ward-specific fixture imports and updated parameter
injection style
test_task_execution_workflow.py
Migrate task execution workflow tests from ward to pytest
agents-api/tests/test_task_execution_workflow.py
• Added
pytest
import and replacedward
test framework• Converted
@test
decorated functions to standardasync def test_*
pytestfunctions
• Updated exception handling from
ward.raises
topytest.raises
• Maintained existing
raises
import from pytest forcompatibility
test_chat_routes.py
Migrate chat route tests from ward to pytest
agents-api/tests/test_chat_routes.py
• Removed
ward
imports and@test
decorators• Converted test functions
to standard pytest naming convention with docstrings
• Updated fixture
parameter injection from ward-style to pytest-style
• Removed
ward-specific fixture imports from the fixtures module
test_task_routes.py
Migrate task route tests from ward to pytest
agents-api/tests/test_task_routes.py
• Replaced
ward
framework withpytest
imports and decorators•
Converted
@test
decorated functions to standard pytest function naming• Updated
@skip
decorator from ward topytest.mark.skip
with reasonparameter
• Moved
CreateTransitionRequest
import to proper locationand updated fixture imports
test_task_validation.py
Migrate task validation tests from ward to pytest
agents-api/tests/test_task_validation.py
• Added
pytest
import and removedward
test framework• Converted
@test
decorated functions to standard pytest function naming withdocstrings
• Added
pytest.mark.skip
decorators for tests requiringmodel investigation
• Maintained existing test logic while updating
framework-specific syntax
test_secrets_queries.py
Migrate secrets query tests from ward to pytest
agents-api/tests/test_secrets_queries.py
• Removed
ward
import and@test
decorators• Converted test functions
to standard pytest naming convention
• Updated fixture parameter
injection from ward-style to pytest-style
• Removed ward-specific
fixture imports from the fixtures module
test_docs_metadata_filtering.py
Migrate docs metadata filtering tests from ward to pytest
agents-api/tests/test_docs_metadata_filtering.py
• Removed
ward
import and@test
decorators• Converted test functions
to standard pytest naming convention with descriptive names
• Updated
fixture parameter injection from ward-style to pytest-style
• Removed
ward-specific fixture imports from the fixtures module
1 files
poe_tasks.toml
Update test runner command to use pytest
agents-api/poe_tasks.toml
• Updated test command from "ward test --exclude .venv" to "pytest"
•
Changed test runner configuration to use pytest instead of Ward
1 files
helpers.py
Refactor task validation logic for better readability
agents-api/agents_api/workflows/task_execution/helpers.py
• Refactored
validate_execution_input
function to extract taskassignment to a separate variable
• Improved code readability by
avoiding direct attribute access in conditional check
• Maintained the
same functionality while making the code more explicit
41 files
Important
Migrated testing framework from Ward to Pytest, updated configurations, and refactored test files for compatibility.
async def test_...
instead of Ward's@test
).poe_tasks.toml
to usepytest
instead ofward
.pyproject.toml
.pyproject.toml
anduv.lock
.fixtures.py
toconftest.py
for Pytest compatibility.raises
from Ward withpytest.raises
.AGENTS.md
to reflect the change in testing framework.This description was created by
for 9cc9095. You can customize this summary. It will automatically update as commits are pushed.