Repository navigation
Add more C API tests #111495
Description
Activity
- addedtestsTests in the Lib/test dirTests in the Lib/test dir3.12only security fixesonly security fixes3.13only security fixesonly security fixes
on Oct 30, 2023 @serhiy-storchaka, initial set of C API tests for PyComplex (only for changed functions) was added in #109647
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.
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.
@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.)
Good catch, @skirpichev. I forgot to add the actual test files.
@serhiy-storchaka , I would like to contribute tests to PyTuple and PyList C API
@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.Reacted by Kalyan RWith 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 #111586Then I'll add missing tests for PyFloat's C API.
- added a commit that references this issue
on Nov 1, 2023 75 remaining items
- added 4 commits that reference this issue
on Jan 18, 2025 @serhiy-storchaka: I added tests on the PyFile C API with #129449. It was the last checkbox. Can we close this issue now?
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.
Reacted by Cody Maloney
Linked PRs
PyFile_*CAPI tests #111709PyCodec_*C API #123343