Skip to content

Improve test_capi.test_structmembers #114392

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

Closed
serhiy-storchaka opened this issue Jan 21, 2024 · 0 comments
Closed

Improve test_capi.test_structmembers #114392

serhiy-storchaka opened this issue Jan 21, 2024 · 0 comments
Labels
3.11 only security fixes 3.12 only security fixes 3.13 bugs and security fixes tests Tests in the Lib/test dir topic-C-API

Comments

@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Jan 21, 2024

test_capi.test_structmembers tests writing and reading attributes that represent C struct members (defined via PyMemberDef). But for most types it only tests 1 or 2 valid values, and maybe yet 1 or 2 values that trigger a RuntimeWarning, for some types. It does not test integer overflow errors. It does not test integer-like objects which are not instances of int (and the range of accepted values is different for such objects due to quirks of implementation). Some bugs (like #114388, but I'll open more issues for other bugs or quirks) are slipped unnoticed.

I'm going to add support for more C types, so I need more comprehensive tests. The proposed PR unifies tests for integer members. It contains some special cases which will be removed when the implementation for integer members be fixed and unified.

Linked PRs

@serhiy-storchaka serhiy-storchaka added tests Tests in the Lib/test dir 3.11 only security fixes topic-C-API 3.12 only security fixes 3.13 bugs and security fixes labels Jan 21, 2024
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Jan 21, 2024
Test all integer member types with extreme values and values outside ov
valid range. Test support of integer-like objects. Test warnings for
wrapped out values.
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Jan 21, 2024
Test all integer member types with extreme values and values outside ov
valid range. Test support of integer-like objects. Test warnings for
wrapped out values.
serhiy-storchaka added a commit that referenced this issue Feb 4, 2024
Test all integer member types with extreme values and values outside of
the valid range. Test support of integer-like objects. Test warnings for
wrapped out values.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 4, 2024
Test all integer member types with extreme values and values outside of
the valid range. Test support of integer-like objects. Test warnings for
wrapped out values.
(cherry picked from commit 15f6f04)

Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit that referenced this issue Feb 4, 2024
…H-115010)

Test all integer member types with extreme values and values outside of
the valid range. Test support of integer-like objects. Test warnings for
wrapped out values.
(cherry picked from commit 15f6f04)

Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Feb 5, 2024
…H-114393)

Test all integer member types with extreme values and values outside of
the valid range. Test support of integer-like objects. Test warnings for
wrapped out values.
(cherry picked from commit 15f6f04)

Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit that referenced this issue Feb 5, 2024
…H-115030)

Test all integer member types with extreme values and values outside of
the valid range. Test support of integer-like objects. Test warnings for
wrapped out values.
(cherry picked from commit 15f6f04)
aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
Test all integer member types with extreme values and values outside of
the valid range. Test support of integer-like objects. Test warnings for
wrapped out values.
fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this issue Feb 14, 2024
Test all integer member types with extreme values and values outside of
the valid range. Test support of integer-like objects. Test warnings for
wrapped out values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes 3.12 only security fixes 3.13 bugs and security fixes tests Tests in the Lib/test dir topic-C-API
Projects
None yet
Development

No branches or pull requests

1 participant