cpython/Modules/_testcapi
Miss Islington (bot) 33d1cfffe1
[3.12] gh-117968: Make the test for closed file more safe in the C API tests (GH-118230) (GH-118266)
The behavior of fileno() after fclose() is undefined, but it is the only
practical way to check whether the file was closed.
Only test this on the known platforms (Linux, Windows, macOS), where we
already tested that it works.
(cherry picked from commit 546cbcfa0e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-04-25 05:16:43 +00:00
..
clinic
abstract.c [3.12] Add more C API tests (GH-112522) (GH-112525) 2023-11-29 22:02:57 +02:00
buffer.c
bytearray.c [3.12] gh-111495: Add tests for PyBytes and PyByteArray C API (GH-111496) (GH-111607) 2023-11-01 18:23:39 +00:00
bytes.c [3.12] gh-111495: Add tests for PyBytes and PyByteArray C API (GH-111496) (GH-111607) 2023-11-01 18:23:39 +00:00
code.c
codec.c [3.12] gh-111495: add stub files for C API test modules (GH-111586) (GH-111592) 2023-11-01 09:43:56 +02:00
complex.c [3.12] gh-109802: Increase test coverage for complexobject.c (GH-112452) (GH-112489) 2023-11-28 08:33:44 +00:00
datetime.c [3.12] bpo-36796: Clean the error handling in _testcapimodule.c (GH-13085) (GH-113132) 2023-12-14 19:39:57 +00:00
dict.c
docstring.c
exceptions.c [3.12] gh-108082: C API: Add tests for PyErr_WriteUnraisable() (GH-111455) (GH-111507) 2023-10-30 17:36:00 +00:00
file.c [3.12] gh-111495: add stub files for C API test modules (GH-111586) (GH-111592) 2023-11-01 09:43:56 +02:00
float.c [3.12] gh-111495: Add tests for PyFloat C API (GH-111624) (GH-111752) 2023-11-05 10:01:31 +02:00
gc.c
getargs.c [3.12] gh-112438: Fix support of format units with the "e" prefix in nested tuples in PyArg_Parse (gh-112439) (GH-112460) 2023-11-27 17:57:30 +00:00
heaptype.c
heaptype_relative.c
immortal.c
list.c [3.12] gh-111495: Add tests for PyList C API (GH-111562) (GH-111861) 2023-11-08 18:10:13 +00:00
long.c [3.12] gh-117021: Fix integer overflow in PyLong_AsPid() on non-Windows 64-bit platforms (GH-117064) (GH-117070) 2024-03-20 16:44:05 +02:00
mem.c [3.12] gh-112536: Add --tsan test for reasonable TSAN execution times. (gh-116601) (#116929) 2024-03-18 10:22:19 +01:00
numbers.c [3.12] gh-111495: add stub files for C API test modules (GH-111586) (GH-111592) 2023-11-01 09:43:56 +02:00
parts.h [3.12] gh-117968: Add tests for the part of the PyRun family of the C API (GH-117982) (GH-118011) 2024-04-22 18:59:28 +00:00
pyos.c
pytime.c
README.txt
run.c [3.12] gh-117968: Make the test for closed file more safe in the C API tests (GH-118230) (GH-118266) 2024-04-25 05:16:43 +00:00
set.c
structmember.c
sys.c [3.12] gh-111065: Add more tests for the C API with the PySys_ prefix (GH-111067) (GH-111305) 2023-10-25 09:10:03 +00:00
testcapi_long.h
tuple.c [3.12] gh-111495: add stub files for C API test modules (GH-111586) (GH-111592) 2023-11-01 09:43:56 +02:00
unicode.c
util.h
vectorcall.c
vectorcall_limited.c
watchers.c

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.