Add test coverage for native descriptors - #341
Merged
GrahamDumpleton merged 1 commit intoMay 22, 2026
Merged
Conversation
Contributor
Author
|
I know these exact tests are not likely ideal since they are mostly just forcing specific behaviors/calls that might not be expected under normal wrapt usage. My goal was mostly to force through the test coverage, and then we can iterate to figure out what makes the most sense to actually land as tests. |
GrahamDumpleton
added a commit
that referenced
this pull request
May 22, 2026
The descriptor __get__ tests added in PR #341 were marked C extension only, which restricted them to one half of the tox matrix and gave no coverage of the pure Python FunctionWrapper.__get__ code path. The bug they guard against only manifests in the C extension because Python's own __get__ slot wrapper performs the Py_None to NULL conversion before the wrapped descriptor is invoked on the pure Python path, but the behavioural assertions are valid for both implementations and the disable-extensions tox environments are the right mechanism for running the suite against the pure Python wrapper. Drop the @c_extension_only skip decorators so the descriptor tests run under both the C and pure Python wrapper variants of the tox matrix. Drop the explicit TestPurePythonWraptPath cases as well: they were only useful while everything else in the file was C extension only, and the disable extensions runs in tox and just now exercise the pure Python wrapper for every test in the file. Drop the TestNativeDescriptorBinding regression cases from test_function_wrapper.py, since they are a strict subset of the cases now running against both implementations from test_descriptor_get_class_access. Expand the module level docstring and add per class comments to describe what each descriptor type test class covers and why it matters.
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.
This PR ensures we have test coverage over:
func_descr_get, wrapperdescr_get, method_get, getset_get, member_get