Skip to content

Add test coverage for native descriptors - #341

Merged
GrahamDumpleton merged 1 commit into
GrahamDumpleton:developfrom
brettlangdon:brettlangdon/descriptor.tests
May 22, 2026
Merged

Add test coverage for native descriptors#341
GrahamDumpleton merged 1 commit into
GrahamDumpleton:developfrom
brettlangdon:brettlangdon/descriptor.tests

Conversation

@brettlangdon

Copy link
Copy Markdown
Contributor

This PR ensures we have test coverage over:

func_descr_get, wrapperdescr_get, method_get, getset_get, member_get

@brettlangdon

Copy link
Copy Markdown
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
GrahamDumpleton merged commit daddcfe into GrahamDumpleton:develop May 22, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants