cpython/Modules/_testcapi
2026-01-09 10:46:48 +00:00
..
clinic
abstract.c
buffer.c
bytes.c gh-129813: Fix PyBytesWriter tests (#139892) 2025-10-10 13:01:06 +02:00
code.c
codec.c
complex.c
config.c
datetime.c
dict.c
docstring.c
exceptions.c
file.c
float.c gh-143429: Use compile-time NaN encoding detection for test_struct (#143432) 2026-01-09 10:46:48 +00:00
frame.c
function.c
gc.c
getargs.c
hash.c
heaptype.c gh-140550: Initial implementation of PEP 793 – PyModExport (GH-140556) 2025-11-05 12:31:42 +01:00
immortal.c gh-133059: Increase the small positive integer cache to 1024 (GH-133160) 2025-09-24 17:05:30 -04:00
import.c
list.c
long.c
mem.c
modsupport.c gh-137210: Add a struct, slot & function for checking an extension's ABI (GH-137212) 2025-09-05 16:23:18 +02:00
module.c gh-141780: Make PyModule_FromSlotsAndSpec enable GIL if needed (GH-141785) 2025-11-24 13:26:35 +01:00
monitoring.c gh-79315: Remove Include/pylock.h and Include/monitoring.h (#139731) 2025-10-08 00:49:24 +02:00
numbers.c
object.c gh-142589: Fix PyUnstable_Object_IsUniqueReferencedTemporary (gh-142593) 2025-12-11 14:41:03 -05:00
parts.h gh-140550: Initial implementation of PEP 793 – PyModExport (GH-140556) 2025-11-05 12:31:42 +01:00
pyatomic.c
README.txt
run.c
set.c
structmember.c
time.c
tuple.c gh-111489: Add PyTuple_FromArray() function (#139691) 2025-10-10 08:54:12 +02:00
type.c
unicode.c
util.h
vectorcall.c
watchers.c

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.