cpython/Modules/_testcapi
2026-05-26 00:03:06 +09:00
..
clinic
abstract.c
buffer.c gh-140557: Force alignment of empty bytearray and array.array buffers (GH-140559) 2026-01-26 16:45:17 +01:00
bytes.c
code.c
codec.c
complex.c
config.c
datetime.c
dict.c gh-141510: Test frozendict C API (#145081) 2026-02-21 17:00:23 +01:00
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 gh-144629: Add test for the PyFunction_GetAnnotations() function (#144630) 2026-02-10 14:38:24 +00:00
gc.c
getargs.c
hash.c
heaptype.c gh-145921: Add "_DuringGC" functions for tp_traverse (GH-145925) 2026-04-08 09:15:11 +02:00
immortal.c gh-143050: Correct PyLong_FromString() to use _PyLong_Negate() (#145901) 2026-03-31 13:17:49 +00:00
import.c gh-149321: Remove lazy_imports=none startup mode (#149389) 2026-05-19 16:01:15 -07:00
list.c
long.c gh-147988: Initialize digits in long_alloc() in debug mode (#147989) 2026-04-02 11:55:34 +00:00
mem.c gh-150114: Log the memory usage in regrtest on macOS (gh-150396) 2026-05-26 00:03:06 +09:00
modsupport.c gh-144175: Add PyArg_ParseArray() function (#144283) 2026-03-06 21:57:44 +00:00
module.c gh-149044: Implement PEP 820 – PySlot: Unified slot system for the C API (GH-149055) 2026-05-05 09:18:04 +02:00
monitoring.c
numbers.c
object.c gh-148829: Make sentinels' repr and module customizable (#149654) 2026-05-19 09:18:56 -07:00
parts.h
pyatomic.c
README.txt
run.c
set.c
structmember.c
time.c
tuple.c
type.c gh-149044: Implement PEP 820 – PySlot: Unified slot system for the C API (GH-149055) 2026-05-05 09:18:04 +02:00
unicode.c Improve tests for the PyUnicodeWriter C API (GH-146157) 2026-03-19 19:15:30 +02:00
util.h
vectorcall.c
watchers.c gh-145235: Make dict watcher API thread-safe for free-threaded builds (gh-145233) 2026-05-11 11:39:55 -04: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.