FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

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

/ cpython Public

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 commented Jan 5, 2024
edited by bedevere-app Bot
Loading

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 Bot added tests Tests in the Lib/test dir awaiting review labels Jan 5, 2024
bedevere-app Bot mentioned this pull request Jan 5, 2024
25 tasks
Comment thread Lib/test/test_ctypes/test_unions.py Outdated
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

aisk commented Jan 9, 2024
edited
Loading

Copy link
Copy Markdown
Member Author

Thanks for the review. All issues mentioned in the comments above should now be fixed.

And I renamed support.py to _support.py, otherwise it will cause an ambiguous import when running with -R : argument:

Traceback (most recent call last):
  File "C:\Users\xxxxx\Source\cpython\Lib\unittest\loader.py", line 113, in loadTestsFromModule
    return load_tests(self, tests, pattern)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\xxxxx\Source\cpython\Lib\test\test_ctypes\__init__.py", line 10, in load_tests
    return support.load_package_tests(os.path.dirname(__file__), *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'test.test_ctypes.support' has no attribute 'load_package_tests'

aisk commented Jan 9, 2024
edited
Loading

Copy link
Copy Markdown
Member Author

Lots of CIs have failed, seems to be related to GitHub's internal error, and this page often returns 500. I think we should re-run the CI after GitHub fixes the server error.

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 changed the title gh-103092: Tests _ctypes type hierarchy and features gh-103092: Test _ctypes type hierarchy and features Jan 9, 2024
erlend-aasland merged commit be89ee5 into python:main Jan 9, 2024
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>
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

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


Back | FazBrowse Home | New Git URL