gh-103092: Test `_ctypes` type hierarchy and features by aisk · Pull Request #113727 · python/cpython · GitHub
Skip to content

gh-103092: Test _ctypes type hierarchy and features - #113727

Merged
erlend-aasland merged 16 commits into
python:mainfrom
aisk:more-ctypes-tests
Jan 9, 2024
Merged

gh-103092: Test _ctypes type hierarchy and features#113727
erlend-aasland merged 16 commits into
python:mainfrom
aisk:more-ctypes-tests

Conversation

@aisk

@aisk aisk commented Jan 5, 2024

Copy link
Copy Markdown
Member

This change is related to #113620 (review), to test the compatibility before and after it.

All classes with metatypes (which have changed in #113620) are tested, plus CField. Other classes are hard to test (can't be accessed in Python easily), or Windows related (I'm not using Windows now), I think it's better to add tests to test them in another PR.

@erlend-aasland

@bedevere-app bedevere-app Bot added tests Tests in the Lib/test dir awaiting review labels Jan 5, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Jan 5, 2024
25 tasks
Comment thread Lib/test/test_ctypes/test_struct_fields.py Outdated
Comment thread Lib/test/test_ctypes/test_unions.py Outdated
@erlend-aasland erlend-aasland changed the title gh-103092: add tests for ctypes to maintain compatibility after isolating it gh-103092: Tests _ctypes type hierarchy and features Jan 6, 2024
Comment thread Lib/test/test_ctypes/test_arrays.py Outdated
Comment thread Lib/test/test_ctypes/test_arrays.py Outdated
Comment thread Lib/test/test_ctypes/support.py Outdated
Comment thread Lib/test/test_ctypes/test_arrays.py Outdated
Comment thread Lib/test/test_ctypes/test_struct_fields.py Outdated
@aisk

aisk commented Jan 9, 2024

Copy link
Copy Markdown
Member Author

@aisk

aisk commented Jan 9, 2024

Copy link
Copy Markdown
Member Author

Comment thread Lib/test/test_ctypes/test_arrays.py Outdated
aisk and others added 2 commits January 9, 2024 22:48
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
@erlend-aasland erlend-aasland changed the title gh-103092: Tests _ctypes type hierarchy and features gh-103092: Test _ctypes type hierarchy and features Jan 9, 2024
@erlend-aasland
erlend-aasland merged commit be89ee5 into python:main Jan 9, 2024
@aisk
aisk deleted the more-ctypes-tests branch January 9, 2024 17:31
kulikjak pushed a commit to kulikjak/cpython that referenced this pull request Jan 22, 2024
)

Test the following features for _ctypes types:
- disallow instantiation
- inheritance (MRO)
- immutability
- type name

The following _ctypes types are tested:
- Array
- CField
- COMError
- PyCArrayType
- PyCFuncPtrType
- PyCPointerType
- PyCSimpleType
- PyCStructType
- Structure
- Union
- UnionType
- _CFuncPtr
- _Pointer
- _SimpleCData

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
aisk added a commit to aisk/cpython that referenced this pull request Feb 11, 2024
)

Test the following features for _ctypes types:
- disallow instantiation
- inheritance (MRO)
- immutability
- type name

The following _ctypes types are tested:
- Array
- CField
- COMError
- PyCArrayType
- PyCFuncPtrType
- PyCPointerType
- PyCSimpleType
- PyCStructType
- Structure
- Union
- UnionType
- _CFuncPtr
- _Pointer
- _SimpleCData

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
)

Test the following features for _ctypes types:
- disallow instantiation
- inheritance (MRO)
- immutability
- type name

The following _ctypes types are tested:
- Array
- CField
- COMError
- PyCArrayType
- PyCFuncPtrType
- PyCPointerType
- PyCSimpleType
- PyCStructType
- Structure
- Union
- UnionType
- _CFuncPtr
- _Pointer
- _SimpleCData

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
encukou pushed a commit to miss-islington/cpython that referenced this pull request Oct 28, 2024
This partially backports be89ee5
(python#113727)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
encukou pushed a commit that referenced this pull request Oct 29, 2024
…on of `ctypes` and metaclasses. (GH-125881) (GH-125988)

cherry picked from commit 1384409
by Jun Komoda

Also: Add test_ctypes/_support.py from 3.13+
This partially backports be89ee5
(#113727)
by AN Long


Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants