Chore: Enable raises for assert #583
Open
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.
Fix DOC504 pydoclint errors by adding Raises sections to test docstrings
Summary
This PR resolves all DOC504 pydoclint errors by adding proper "Raises" sections to test function docstrings that contain assert statements. Instead of suppressing these errors in the baseline file, we've chosen to properly document that test functions can raise
AssertionError
when their assertions fail.Changes Made
Updated Test Files
Added
Raises: AssertionError
sections with descriptive messages to the following test files:tests/integration/test_cli.py
(2 functions)test_version()
- Documents assertion failures for version output validationtest_server_fail_no_deps()
- Documents assertion failures for error message validationtests/unit/test_basic.py
(2 functions)test_main()
- Documents assertion failures for expected error code validationtest_cli_main()
- Documents assertion failures for expected error code validationtests/unit/test_server_utils.py
(4 functions)test_validate_request_pass()
- Documents assertion failures for validation resultstest_validate_request_fail()
- Documents assertion failures for unexpected validation passestest_validate_response_pass()
- Documents assertion failures for validation resultstest_validate_response_fail()
- Documents assertion failures for unexpected validation passestests/integration/test_server_creator_v1.py
(3 functions)test_error_v1()
- Documents assertion failures for response validationtest_playbook_v1()
- Documents assertion failures for response validationtest_collection_v1()
- Documents assertion failures for response validationtests/integration/test_server_creator_v2.py
(3 functions)test_error_v2()
- Documents assertion failures for response validationtest_playbook_v2()
- Documents assertion failures for response validationtest_collection_v2()
- Documents assertion failures for response validationtests/integration/test_server_info.py
(1 function)test_metadata()
- Documents assertion failures for response validationtests/unit/test_server.py
(1 function)test_server_debug_options()
- Documents assertion failures for server option validationtests/integration/test_container.py
(12 functions)Total Impact
Rationale
Rather than suppressing these linting errors in the baseline file, we chose to properly document the
AssertionError
exceptions that test functions can raise. This approach:Testing
Files Changed