Repository navigation
Add more C API tests #111495
Copy link
Copy link
Closed
Labels
3.12only security fixesonly security fixes3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixestestsTests in the Lib/test dirTests in the Lib/test dirtopic-C-API
Description
- 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
- gh-111495: Add tests for PyBytes and PyByteArray C API #111496
- gh-111495: Add tests for PyList C API #111562
- gh-111495: add stub files for C API test modules #111586
- gh-111495: Add tests for PyComplex C API #111591
- [3.12] gh-111495: add stub files for C API test modules (GH-111586) #111592
- gh-111495: Add tests for PyTuple C API #111606
- [3.12] gh-111495: Add tests for PyBytes and PyByteArray C API (GH-111496) #111607
- gh-111495: Add tests for PyFloat C API #111624
- gh-111495: Test C API functions with extreme sizes and indices #111631
- gh-111495: Add
PyFile_*CAPI tests #111709 - [3.12] gh-111495: Test C API functions with extreme sizes and indices (GH-111631) #111731
- [3.12] gh-111495: Add tests for PyFloat C API (GH-111624) #111752
- [3.12] gh-111495: Add tests for PyComplex C API (GH-111591) #111753
- [3.12] gh-111495: Add tests for PyList C API (GH-111562) #111861
- gh-111495: Add tests for PyNumber C API #111996
- gh-111495: Add tests for PyTuple C API #118757
- gh-111495: Add more tests on PyEval C APIs #122789
- gh-111495: Add tests on PyTuple C APIs #122833
- gh-111495: Fix refleaks in test_capi.test_eval tests #122851
- gh-111495: Remove test_capi test_rshift_print() #123338
- gh-111495: Add tests for
PyCodec_*C API #123343 - [3.13] gh-111495: Add tests for PyTuple C API (GH-118757) #123371
- [3.13] gh-111495: Add tests for PyNumber C API (GH-111996) #123375
- [3.12] gh-111495: Add tests for PyNumber C API (GH-111996) #123376
- [3.12] gh-111495: Add tests for PyTuple C API (GH-118757) #123379
- gh-111495: Add tests for PyFile C API #124915
- gh-111495: improve test coverage of codecs C API #126030
- [3.13] gh-111495: Add more tests on PyEval C APIs (#122789) #128987
- [3.12] gh-111495: Add more tests on PyEval C APIs (#122789) (#128987) #129023
- gh-111495: Add PyFile tests #129449
- [3.13] gh-111495: Add PyFile tests (#129449) #129477
- [3.12] gh-111495: Add PyFile tests (#129449) (#129477) #129501
Reacted by Erlend E. Aasland, Kalyan R, Victor Stinner and Cody Maloney
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixes3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixestestsTests in the Lib/test dirTests in the Lib/test dirtopic-C-API
Activity
pythongh-111495: Add tests for PyBytes and PyByteArray C API
skirpichev commentedon Oct 31, 2023
@serhiy-storchaka, initial set of C API tests for PyComplex (only for changed functions) was added in #109647
serhiy-storchaka commentedon 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 commentedon 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 commentedon 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 commentedon Oct 31, 2023
Good catch, @skirpichev. I forgot to add the actual test files.
rawwar commentedon Oct 31, 2023
@serhiy-storchaka , I would like to contribute tests to PyTuple and PyList C API
serhiy-storchaka commentedon Oct 31, 2023
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 commentedon 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.
pythongh-111495: add stub files for test modules
75 remaining items
pythongh-111495: improve test coverage of codecs C API (pythonGH-126030)
pythongh-111495: Add more tests on PyEval C APIs (python#122789)
pythongh-111495: Fix refleaks in test_capi.test_eval tests (python#12…
[3.13] gh-111495: Add more tests on PyEval C APIs (#122789) (#128987)
[3.12] gh-111495: Add more tests on PyEval C APIs (#122789) (#128987) (…
pythongh-111495: Add PyFile tests
pythongh-111495: Add PyFile tests
gh-111495: Add PyFile tests (#129449)
pythongh-111495: Add PyFile tests (python#129449)
vstinner commentedon 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?
[3.13] gh-111495: Add PyFile tests (#129449) (#129477)
[3.12] gh-111495: Add PyFile tests (#129449) (#129477) (#129501)
vstinner commentedon 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.
pythongh-111495: Add PyFile tests (python#129449)