cpython/Modules/_testcapi
Victor Stinner 1a3faba9f1
gh-106869: Use new PyMemberDef constant names (#106871)
* Remove '#include "structmember.h"'.
* If needed, add <stddef.h> to get offsetof() function.
* Update Parser/asdl_c.py to regenerate Python/Python-ast.c.
* Replace:

  * T_SHORT => Py_T_SHORT
  * T_INT => Py_T_INT
  * T_LONG => Py_T_LONG
  * T_FLOAT => Py_T_FLOAT
  * T_DOUBLE => Py_T_DOUBLE
  * T_STRING => Py_T_STRING
  * T_OBJECT => _Py_T_OBJECT
  * T_CHAR => Py_T_CHAR
  * T_BYTE => Py_T_BYTE
  * T_UBYTE => Py_T_UBYTE
  * T_USHORT => Py_T_USHORT
  * T_UINT => Py_T_UINT
  * T_ULONG => Py_T_ULONG
  * T_STRING_INPLACE => Py_T_STRING_INPLACE
  * T_BOOL => Py_T_BOOL
  * T_OBJECT_EX => Py_T_OBJECT_EX
  * T_LONGLONG => Py_T_LONGLONG
  * T_ULONGLONG => Py_T_ULONGLONG
  * T_PYSSIZET => Py_T_PYSSIZET
  * T_NONE => _Py_T_NONE
  * READONLY => Py_READONLY
  * PY_AUDIT_READ => Py_AUDIT_READ
  * READ_RESTRICTED => Py_AUDIT_READ
  * PY_WRITE_RESTRICTED => _Py_WRITE_RESTRICTED
  * RESTRICTED => (READ_RESTRICTED | _Py_WRITE_RESTRICTED)
2023-07-25 15:28:30 +02:00
..
clinic gh-104469: Convert_testcapi/vectorcall.c to use AC (gh-106557) 2023-07-09 21:08:18 +09:00
buffer.c gh-106869: Use new PyMemberDef constant names (#106871) 2023-07-25 15:28:30 +02:00
code.c gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_HasAttr (GH-106034) 2023-06-23 20:10:32 +03:00
datetime.c gh-99300: Replace Py_INCREF() with Py_NewRef() (#99513) 2022-11-16 10:39:47 +01:00
docstring.c gh-93649: Split memory and docstring tests from _testcapimodule.c (#99517) 2022-11-16 14:09:10 +01:00
exceptions.c gh-105071: add PyUnstable_Exc_PrepReraiseStar to expose except* implementation in the unstable API (#105072) 2023-05-30 15:03:36 +01:00
float.c gh-104922: remove PY_SSIZE_T_CLEAN (#106315) 2023-07-02 15:07:46 +09:00
gc.c gh-93649: Split gc- and allocation tests from _testcapimodule.c (GH-104403) 2023-05-12 10:26:07 +01:00
getargs.c gh-104922: remove PY_SSIZE_T_CLEAN (#106315) 2023-07-02 15:07:46 +09:00
heaptype.c gh-106869: Use new PyMemberDef constant names (#106871) 2023-07-25 15:28:30 +02:00
heaptype_relative.c gh-103509: PEP 697 -- Limited C API for Extending Opaque Types (GH-103511) 2023-05-04 09:56:53 +02:00
immortal.c Trim trailing whitespace and test on CI (#104275) 2023-05-08 17:03:52 +03:00
long.c gh-104469: Convert _testcapi/long to use AC (gh-104720) 2023-05-23 22:52:36 +09:00
mem.c gh-106320: Remove private _PyMem API (#107187) 2023-07-24 18:48:06 +00:00
parts.h gh-106316: Remove pytime.h header file (#106317) 2023-07-01 22:27:18 +00:00
pyos.c GH-94808: Cover PyOS_mystrnicmp and PyOS_mystricmp (gh-102469) 2023-03-22 20:35:27 +09:00
pytime.c gh-106316: Remove pytime.h header file (#106317) 2023-07-01 22:27:18 +00:00
README.txt gh-104469: Update README.txt for _testcapi (gh-104529) 2023-05-17 12:56:20 +09:00
structmember.c gh-47146: Fix reference counting in _testcapi.structmember initializer (GH-106862) 2023-07-21 12:30:14 +03:00
testcapi_long.h gh-93649: Split float/long tests from _testcapimodule.c (GH-99549) 2022-11-17 00:56:56 -08:00
unicode.c gh-99593: Add tests for Unicode C API (part 3) (GH-104728) 2023-07-10 14:04:34 +03:00
vectorcall.c gh-106869: Use new PyMemberDef constant names (#106871) 2023-07-25 15:28:30 +02:00
vectorcall_limited.c gh-106869: Use new PyMemberDef constant names (#106871) 2023-07-25 15:28:30 +02:00
watchers.c gh-86493: Use PyModule_Add() instead of PyModule_AddObjectRef() (GH-106860) 2023-07-18 23:59:53 +03: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.