Skip to content

Add tests for setting and deleting attributes defined in C #156106

Description

@serhiy-storchaka

CPython defines 375 attributes with PyMemberDef and PyGetSetDef (excluding the _test* modules), but the test suite never assigns to 187 of them and never deletes 332 of them.

Deletion in particular is almost untested, although it is a separate code path: the setter is called with NULL, and an implementation which does not expect this crashes or leaves the object in a broken state.

Three bugs found this way are gh-156099, gh-156100 and gh-156101; gh-152817 is another one.

The following PR adds writing and deleting tests for each writable attribute.

Linked PRs

Activity

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

    testsTests in the Lib/test dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions