Skip to content

Add more C API tests #111495

Description

@serhiy-storchaka
  • Add tests for PyBytes C API
  • Add tests for PyByteArray C API
  • Add tests for PyFloat C API
  • Add tests for PyComplex C API
  • Add tests for PyLong C API
  • Add tests for PyNumber C API
  • Add tests for PyTuple C API
  • Add tests for PyList C API
  • Add tests for PyCodec C API
  • Add tests for PyFile C API

Linked PRs

Activity

  1. added a commit that references this issue on Oct 30, 2023
  2. skirpichev commented on Oct 31, 2023

    @skirpichev
    Member

    @serhiy-storchaka, initial set of C API tests for PyComplex (only for changed functions) was added in #109647

  3. serhiy-storchaka commented on Oct 31, 2023

    @serhiy-storchaka
    MemberAuthor

    Yes, there are also some tests for PyLong and PyNumber, and maybe other parts of the C API. But we should test the full C API, or at least document what is not tested. And it is better to group tests by the prefix, so it is clear where to find tests.

  4. serhiy-storchaka commented on Oct 31, 2023

    @serhiy-storchaka
    MemberAuthor

    If you want to work on adding tests to the part of the C API, say it here to avoid duplicating the work of other people. I finished work on PyBytes and PyByteArray and am not currently working on any of the above.

  5. skirpichev commented on Oct 31, 2023

    @skirpichev
    Member

    @serhiy-storchaka, I will factor out tests PyComplex_RealAsDouble/ImagAsDouble from #109647 and tests for other functions for PyComplexType. (BTW, in #111496 I don't see actual tests, only interfaces. Tests in my pr were modeled from pack/unpack tests in test_float.py.)

  6. serhiy-storchaka commented on Oct 31, 2023

    @serhiy-storchaka
    MemberAuthor

    Good catch, @skirpichev. I forgot to add the actual test files.

  7. rawwar commented on Oct 31, 2023

    @rawwar
    Contributor

    @serhiy-storchaka , I would like to contribute tests to PyTuple and PyList C API

  8. serhiy-storchaka commented on Oct 31, 2023

    @serhiy-storchaka
    MemberAuthor

    @serhiy-storchaka , I would like to contribute tests to PyTuple and PyList C API

    Great. Look at existing PySequence tests in Lib/test/test_capi/test_abstract.py. Some PyTuple and PyList tests can be a copy of PySequence tests. Look also at PyDict and PySet tests.

  9. skirpichev commented on Nov 1, 2023

    @skirpichev
    Member

    With multiple prs, Modules/Setup.stdlib.in will produce merge conflicts. (I already have fixed this a lot in #109647.) I will create a pr to add stub files for testing modules.

    Edit:
    #111586 - stub files for test modules
    #111591 - tests for PyComplex C API on top of #111586

    Then I'll add missing tests for PyFloat's C API.

  10. added a commit that references this issue on Nov 1, 2023
  11. 75 remaining items

  12. added a commit that references this issue on Jan 12, 2025
  13. added 4 commits that reference this issue on Jan 18, 2025
  14. added 4 commits that reference this issue on Jan 29, 2025
  15. vstinner commented on Jan 30, 2025

    @vstinner
    Member

    @serhiy-storchaka: I added tests on the PyFile C API with #129449. It was the last checkbox. Can we close this issue now?

  16. added 2 commits that reference this issue on Jan 30, 2025
  17. vstinner commented on Feb 6, 2025

    @vstinner
    Member

    I close the issue. A lot of work has been done in this issue!

    If someone wants to continue this work, I suggest to open new issues such as #117968.

  18. added a commit that references this issue on Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

3.12only security fixes3.13only security fixes3.14bugs and 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