cpython/Modules/_testcapi
Victor Stinner c5fa796619
gh-116417: Fix make check-c-globals for _testlimitedcapi (#116570)
* Remove unused '_testcapimodule' global in Modules/_testcapi/unicode.c.
* Update c-analyzer to not use the internal C API in
  _testlimitedcapi.c.
2024-03-10 20:19:47 +00:00
..
clinic gh-116417: Add _testlimitedcapi C extension (#116419) 2024-03-07 18:31:12 +00:00
README.txt
abstract.c
buffer.c gh-114685: Check flags in PyObject_GetBuffer() (GH-114707) 2024-01-31 13:11:35 +02:00
bytearray.c
bytes.c gh-111495: Add tests for PyBytes and PyByteArray C API (GH-111496) 2023-11-01 17:31:07 +02:00
code.c
codec.c
complex.c
datetime.c
dict.c gh-112066: Add `PyDict_SetDefaultRef` function. (#112123) 2024-02-06 11:36:23 -05:00
docstring.c
exceptions.c
file.c
float.c
gc.c
getargs.c
hash.c
heaptype.c
immortal.c
list.c gh-114329: Add `PyList_GetItemRef` function (GH-114504) 2024-02-02 14:03:15 +01:00
long.c gh-111140: Adds PyLong_AsNativeBytes and PyLong_FromNative[Unsigned]Bytes functions (GH-114886) 2024-02-12 20:13:13 +00:00
mem.c
numbers.c
parts.h gh-116417: Add _testlimitedcapi C extension (#116419) 2024-03-07 18:31:12 +00:00
pyatomic.c
pyos.c
set.c
structmember.c
sys.c
testcapi_long.h
time.c gh-110850: Enhance PyTime C API tests (#115715) 2024-02-20 15:53:40 +01:00
tuple.c
unicode.c gh-116417: Fix make check-c-globals for _testlimitedcapi (#116570) 2024-03-10 20:19:47 +00:00
util.h
vectorcall.c
watchers.c GH-113710: Add a "globals to constants" pass (GH-114592) 2024-02-02 12:14:34 +00:00

README.txt

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.