Improve test coverage for src/call.rs#5951
Draft
leftygbalogh wants to merge 3 commits intoPyO3:mainfrom
Draft
Conversation
added 3 commits
April 5, 2026 18:28
The check_call! macros in test_call and test_call_positional ignored their \ parameter, always calling with the outer args.clone() (Bound<'py, PyTuple>). All five invocations therefore tested only the Bound path, leaving &Bound, Py, &Py, and Borrowed impls uncovered. Fix both macros to use \ and \ so each invocation exercises the intended PyCallArgs impl. Add three new tests: - test_call_unit_args: covers ()::call and ()::call_positional impls - test_call_method_positional_default: covers the default call_method_positional trait method (happy path + AttributeError path) - test_call_error_paths: covers the error return paths in Borrowed::call and Borrowed::call_positional (TypeError from PyObject_Call)
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.
Closes #2453 (partially). Fixes check_call! macro bug and adds tests for uncovered paths.