Skip to content

Commit b5430d3

Browse files
corona10erlend-aaslandEclips4
authored andcommitted
pythongh-104469: Update README.txt for _testcapi (pythongh-104529)
* pythongh-104469: Update README.txt for _testcapi Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
1 parent f98dfcc commit b5430d3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Modules/_testcapi/README.txt

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
Tests in this directory are compiled into the _testcapi extension.
22
The main file for the extension is Modules/_testcapimodule.c, which
33
calls `_PyTestCapi_Init_*` from these functions.
4+
5+
General guideline when writing test code for C API.
6+
* Use Argument Clinic to minimise the amount of boilerplate code.
7+
* Add a newline between the argument spec and the docstring.
8+
* If a test description is needed, make sure the added docstring clearly and succinctly describes purpose of the function.
9+
* DRY, use the clone feature of Argument Clinic.
10+
* 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.

0 commit comments

Comments
 (0)