cpython/Modules/_testcapi
Victor Stinner 1cc02ca063
gh-116417: Move 4 limited C API test files to _testlimitedcapi (#116571)
Move the following files from Modules/_testcapi/ to
Modules/_testlimitedcapi/:

* bytearray.c
* bytes.c
* pyos.c
* sys.c

Changes:

* Replace PyBytes_AS_STRING() with PyBytes_AsString().
* Replace PyBytes_GET_SIZE() with PyBytes_Size().
* Update related test_capi tests.
* Copy Modules/_testcapi/util.h to Modules/_testlimitedcapi/util.h.
2024-03-11 10:28:16 +00:00
..
clinic gh-116417: Add _testlimitedcapi C extension (#116419) 2024-03-07 18:31:12 +00:00
README.txt gh-104469: Update README.txt for _testcapi (gh-104529) 2023-05-17 12:56:20 +09:00
abstract.c Add more C API tests (GH-112522) 2023-11-29 17:37:05 +02:00
buffer.c gh-114685: Check flags in PyObject_GetBuffer() (GH-114707) 2024-01-31 13:11:35 +02:00
code.c C API tests: use special markers to test that output parameters were set (GH-109014) 2023-09-06 22:02:01 +03:00
codec.c gh-111495: add stub files for C API test modules (GH-111586) 2023-11-01 07:44:54 +02:00
complex.c gh-109802: Increase test coverage for complexobject.c (GH-112452) 2023-11-28 10:18:33 +02:00
datetime.c bpo-36796: Clean the error handling in _testcapimodule.c (GH-13085) 2023-12-14 19:06:53 +00:00
dict.c gh-112066: Add `PyDict_SetDefaultRef` function. (#112123) 2024-02-06 11:36:23 -05:00
docstring.c gh-107782: Use _testcapi to test non-representable signatures (GH-109325) 2023-09-14 09:12:17 +03:00
exceptions.c gh-108082: Add PyErr_FormatUnraisable() function (GH-111086) 2023-10-31 23:42:44 +02:00
file.c gh-111495: add stub files for C API test modules (GH-111586) 2023-11-01 07:44:54 +02:00
float.c gh-111495: Add tests for PyFloat C API (GH-111624) 2023-11-05 09:20:12 +02:00
gc.c gh-113750: Fix object resurrection in free-threaded builds (gh-113751) 2024-01-06 12:12:26 +09:00
getargs.c gh-114101: Correct PyErr_Format arguments in _testcapi module (#114102) 2024-01-16 09:32:39 +01:00
hash.c gh-111545: Add Py_HashPointer() function (#112096) 2023-12-06 15:09:22 +01:00
heaptype.c gh-107073: Make PyObject_VisitManagedDict() public (#108763) 2023-10-02 19:24:08 +02:00
immortal.c Trim trailing whitespace and test on CI (#104275) 2023-05-08 17:03:52 +03:00
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 gh-90815: Add mimalloc memory allocator (#109914) 2023-10-30 15:43:11 +00:00
numbers.c gh-111495: add stub files for C API test modules (GH-111586) 2023-11-01 07:44:54 +02:00
parts.h gh-116417: Move 4 limited C API test files to _testlimitedcapi (#116571) 2024-03-11 10:28:16 +00:00
pyatomic.c gh-109693: Update _gil_runtime_state.locked to use pyatomic.h (gh-110836) 2023-10-17 07:32:50 +09:00
set.c gh-110525: Cover PySet_Add corner case with frozenset objects (GH-110544) 2023-10-09 14:04:49 +03: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
time.c gh-110850: Enhance PyTime C API tests (#115715) 2024-02-20 15:53:40 +01:00
tuple.c gh-111495: add stub files for C API test modules (GH-111586) 2023-11-01 07:44:54 +02:00
unicode.c gh-116417: Fix make check-c-globals for _testlimitedcapi (#116570) 2024-03-10 20:19:47 +00:00
util.h gh-109469: Silence compiler warnings on string comparisons in _testcapi (GH-109533) 2023-09-19 08:12:29 +03:00
vectorcall.c gh-110964: Remove private _PyArg functions (#110966) 2023-10-17 14:30:31 +02:00
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.