cpython/Modules/_testcapi
2025-05-05 21:01:20 +02:00
..
clinic gh-130317: Fix test_pack_unpack_roundtrip() and add docs (#133204) 2025-05-01 16:20:36 +02:00
abstract.c gh-130947: Add again PySequence_Fast() to the limited C API (#130948) 2025-03-13 13:00:57 +01:00
buffer.c gh-111178: fix UBSan failures for Modules/_testcapi/{buffer,monitoring}.c (#131613) 2025-03-24 11:06:37 +01:00
bytes.c
code.c gh-128911: Use PyImport_ImportModuleAttr() function (#129657) 2025-02-05 11:03:58 +01:00
codec.c gh-111495: Add tests for PyCodec_* C API (#123343) 2024-09-29 15:22:39 +00:00
complex.c gh-128813: hide mixed-mode functions for complex arithmetic from C-API (#131703) 2025-04-22 14:18:18 +02:00
config.c
datetime.c gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_STR) (#125194) 2024-10-09 17:15:23 +02:00
dict.c gh-93649: Move _testcapi tests to specific files (#129544) 2025-02-01 13:39:16 +01:00
docstring.c gh-111178: remove redundant casts for functions with correct signatures (#131673) 2025-04-01 17:18:11 +02:00
exceptions.c gh-111178: remove redundant casts for functions with correct signatures (#131673) 2025-04-01 17:18:11 +02:00
file.c gh-132162: Add tests for Py_UniversalNewlineFgets() (#132164) 2025-04-24 17:43:48 +02:00
float.c gh-130317: Fix test_pack_unpack_roundtrip() and add docs (#133204) 2025-05-01 16:20:36 +02:00
frame.c gh-93649: Move PyFrame C API tests to test_capi (#129512) 2025-01-31 13:51:58 +01:00
function.c gh-93649: Add Modules/_testcapi/function.c file (#129521) 2025-01-31 16:02:50 +01:00
gc.c gh-111178: remove redundant casts for functions with correct signatures (#131673) 2025-04-01 17:18:11 +02:00
getargs.c
hash.c
heaptype.c gh-133166: Fix missing error emission of PyType_GetModuleByDef (GH-133240) 2025-05-01 14:32:57 +02:00
immortal.c gh-127119: Faster check for small ints in long_dealloc (GH-127620) 2025-01-29 15:22:18 +00:00
import.c gh-128911: Add PyImport_ImportModuleAttr() function (#128912) 2025-01-30 11:17:29 +00:00
list.c gh-93649: Move _testcapi tests to specific files (#129544) 2025-02-01 13:39:16 +01:00
long.c gh-102471, PEP 757: Add PyLong import and export API (#121339) 2024-12-13 14:24:48 +01:00
mem.c gh-111178: remove redundant casts for functions with correct signatures (#131673) 2025-04-01 17:18:11 +02:00
monitoring.c gh-111178: fix UBSan failures for Modules/_testcapi/{buffer,monitoring}.c (#131613) 2025-03-24 11:06:37 +01:00
numbers.c
object.c gh-133140: Add PyUnstable_Object_IsUniquelyReferenced for free-threading (#133144) 2025-05-05 21:01:20 +02:00
parts.h gh-93649: Add Modules/_testcapi/function.c file (#129521) 2025-01-31 16:02:50 +01:00
pyatomic.c
README.txt
run.c
set.c gh-93649: Move _testcapi tests to specific files (#129544) 2025-02-01 13:39:16 +01:00
structmember.c gh-127572: Fix test_structmembers initialization (GH-127577) 2024-12-04 09:58:22 +01:00
time.c
tuple.c
type.c gh-93649: Add Modules/_testcapi/type.c file (#129516) 2025-01-31 15:03:54 +01:00
unicode.c
util.h gh-111495: Add tests for PyCodec_* C API (#123343) 2024-09-29 15:22:39 +00:00
vectorcall.c
watchers.c gh-111178: remove redundant casts for functions with correct signatures (#131673) 2025-04-01 17:18:11 +02: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.