cpython/Modules/_testcapi
Victor Stinner 01af34a364
[3.13] gh-143050: Correct PyLong_FromString() to use _PyLong_Negate() (#145901) (#147437)
The long_from_string_base() might return a small integer, when the
_pylong.py is used to do conversion.  Hence, we must be careful here to
not smash it "small int" bit by using the _PyLong_FlipSign().

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit db5936c5b8)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2026-03-31 17:06:38 +02:00
..
clinic [3.13] gh-111495: Add PyFile tests (#129449) (#129477) 2025-01-30 20:29:27 +01:00
abstract.c
buffer.c
bytes.c
code.c
codec.c
complex.c
datetime.c
dict.c
docstring.c
exceptions.c
file.c [3.13] gh-111495: Add PyFile tests (#129449) (#129477) 2025-01-30 20:29:27 +01:00
float.c
gc.c
getargs.c
hash.c
heaptype.c [3.13] gh-129849: Add tests for Py_tp_bases (GH-143208) (#146226) 2026-03-21 15:22:45 +05:30
immortal.c [3.13] gh-143050: Correct PyLong_FromString() to use _PyLong_Negate() (#145901) (#147437) 2026-03-31 17:06:38 +02:00
list.c
long.c
mem.c
monitoring.c
numbers.c
object.c
parts.h
pyatomic.c
README.txt
run.c
set.c
structmember.c
time.c
tuple.c
unicode.c
util.h
vectorcall.c [3.13] gh-136288: Fix error message in _testcapi/vectorcall.c (GH-136258) (GH-136295) 2025-07-04 16:17:10 +00:00
watchers.c [3.13] gh-146615: Fix format specifiers in test cextensions (GH-146618) (GH-146653) 2026-03-31 08:38:59 +00:00

Tests in this directory are compiled into the _testcapi extension.
The main file for the extension is Modules/_testcapimodule.c, which
calls `_PyTestCapi_Init_*` from these functions.

General guideline when writing test code for C API.
* Use Argument Clinic to minimise the amount of boilerplate code.
* Add a newline between the argument spec and the docstring.
* If a test description is needed, make sure the added docstring clearly and succinctly describes purpose of the function.
* DRY, use the clone feature of Argument Clinic.
* Try to avoid adding new interned strings; reuse existing parameter names if possible. Use the `as` feature of Argument Clinic to override the C variable name, if needed.