GeezerVison is showing github.com — Add more C API tests · Issue #111495 · python/cpython
Add more C API tests #111495Description
- 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
Reacted by Erlend E. Aasland, Kalyan R, Victor Stinner and Cody Maloney Activityskirpichev commented on Oct 31, 2023 serhiy-storchaka commented on Oct 31, 2023 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. serhiy-storchaka commented on Oct 31, 2023 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. skirpichev commented on Oct 31, 2023 @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.) serhiy-storchaka commented on Oct 31, 2023 Good catch, @skirpichev. I forgot to add the actual test files. rawwar commented on Oct 31, 2023 serhiy-storchaka commented on Oct 31, 2023
@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. skirpichev commented on Nov 1, 2023 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. vstinner commented on Jan 30, 2025 @serhiy-storchaka: I added tests on the PyFile C API with #129449. It was the last checkbox. Can we close this issue now? vstinner commented on Feb 6, 2025 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.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|