Skip to content

Improve test_capi.test_structmembers #114392

Closed

Description

@serhiy-storchaka

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

Activity

  1. added 2 commits that reference this issue on Jan 21, 2024
  2. added a commit that references this issue on Feb 4, 2024
  3. added a commit that references this issue on Feb 4, 2024
  4. added 3 commits that reference this issue on Feb 4, 2024
  5. added a commit that references this issue on Feb 11, 2024
  6. added a commit that references this issue on Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixes3.12only security fixes3.13only security fixestestsTests in the Lib/test dirtopic-C-API

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions