Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 16 commits into from Jan 9, 2024

Conversation

aisk
Copy link
Contributor

@aisk aisk commented Jan 5, 2024

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
23 tasks
@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
Lib/test/test_ctypes/support.py Outdated Show resolved Hide resolved
Lib/test/test_ctypes/test_arrays.py Outdated Show resolved Hide resolved
Lib/test/test_ctypes/test_struct_fields.py Outdated Show resolved Hide resolved
@aisk
Copy link
Contributor Author

aisk commented Jan 9, 2024

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
Copy link
Contributor Author

aisk commented Jan 9, 2024

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.

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
27 checks passed
@aisk aisk deleted the more-ctypes-tests branch January 9, 2024 17:31
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.

None yet

2 participants