summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapi
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-117021: Fix integer overflow in PyLong_AsPid() on non-Windows ↵Serhiy Storchaka2024-03-201-0/+13
| | | | | 64-bit platforms (GH-117064) (GH-117070) (cherry picked from commit 519b2ae22b54760475bbf62b9558d453c703f9c6)
* [3.12] gh-112536: Add --tsan test for reasonable TSAN execution times. ↵Antoine Pitrou2024-03-181-2/+2
| | | | | | | | (gh-116601) (#116929) (cherry picked from commit ebf29b3) Co-authored-by: Donghee Na <donghee.na@python.org>
* [3.12] bpo-36796: Clean the error handling in _testcapimodule.c (GH-13085) ↵Miss Islington (bot)2023-12-141-8/+38
| | | | | | | (GH-113132) (cherry picked from commit a723a13bf135306cdc5999a959596bfb487e8f4f) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.12] Add more C API tests (GH-112522) (GH-112525)Miss Islington (bot)2023-11-291-0/+33
| | | | | | | Add tests for PyObject_Str(), PyObject_Repr(), PyObject_ASCII() and PyObject_Bytes(). (cherry picked from commit e0449b9a7fffc0c0eed806bf4cbb8f1f65397bbb) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-109802: Increase test coverage for complexobject.c (GH-112452) ↵Miss Islington (bot)2023-11-281-0/+59
| | | | | | | (GH-112489) (cherry picked from commit f14d741daa1b9e5b9c9fc1edba93d0fa92b5ba8d) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
* [3.12] gh-112438: Fix support of format units with the "e" prefix in nested ↵Miss Islington (bot)2023-11-271-5/+9
| | | | | | | tuples in PyArg_Parse (gh-112439) (GH-112460) (cherry picked from commit 4eea1e82369fbf7a795d1956e7a8212a1b58009f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-111495: Add tests for PyList C API (GH-111562) (GH-111861)Miss Islington (bot)2023-11-081-1/+179
| | | | | | | | (cherry picked from commit a3903c8ec838f82338f7a7af68a6699118778e1d) Signed-off-by: kalyanr <kalyan.ben10@live.com> Co-authored-by: Kalyan <kalyan.ben10@live.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-111495: Add tests for PyComplex C API (GH-111591) (GH-111753)Miss Islington (bot)2023-11-051-0/+92
| | | | | (cherry picked from commit 24b5cbd3dce3fe37cdc787ccedd1e73a4f8cfc3c) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
* [3.12] gh-111495: Add tests for PyFloat C API (GH-111624) (GH-111752)Miss Islington (bot)2023-11-051-0/+74
| | | | | (cherry picked from commit b452202a11c4cb60f69a098a0076a8a8aabade38) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
* [3.12] gh-111495: Add tests for PyBytes and PyByteArray C API (GH-111496) ↵Miss Islington (bot)2023-11-012-0/+346
| | | | | | | (GH-111607) (cherry picked from commit 97b3cd38d105fd891ba46dd27d08f03d1c6dd348) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-111495: add stub files for C API test modules (GH-111586) (GH-111592)Sergey B Kirpichev2023-11-019-2/+144
| | | | | This is to reduce merge conflicts (Modules/Setup.stdlib.in) for subsequent pull requests for the issue. (cherry picked from commit 33ed5fa69dbe25d64a910c450be527f4db9dc5dd)
* [3.12] gh-108082: C API: Add tests for PyErr_WriteUnraisable() (GH-111455) ↵Miss Islington (bot)2023-10-301-0/+17
| | | | | | | | (GH-111507) Also document the behavior when called with NULL. (cherry picked from commit bca330542912532baa33af20a107fcf956cf007a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-111065: Add more tests for the C API with the PySys_ prefix ↵Serhiy Storchaka2023-10-252-0/+58
| | | | | | | | | | | | (GH-111067) (GH-111305) * Move existing tests for PySys_GetObject() and PySys_SetObject() into specialized files. * Add test for PySys_GetXOptions() using _testcapi. * Add tests for PySys_FormatStdout(), PySys_FormatStderr(), PySys_WriteStdout() and PySys_WriteStderr() using ctypes. (cherry picked from commit b2ba2985275d1200e5c44c3f224d754141fc5292)
* [3.12] gh-110572: Fix potential leaks in test_*_code in _testcapi/getargs.c ↵Miss Islington (bot)2023-10-211-33/+57
| | | | | | | (GH-110573) (GH-111161) (cherry picked from commit f71cd5394efe154ba92228b2b67be910cc1ede95) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-110628: Add tests for PyLong C API (GH-110629) (GH-110854)Serhiy Storchaka2023-10-141-0/+222
| | | (cherry picked from commit 9d40ebf1902812fad6aa85ede7b6f1fdff3c1291)
* [3.12] gh-110815: Improve tests for PyArg_ParseTupleAndKeywords() ↵Miss Islington (bot)2023-10-131-13/+39
| | | | | | | (GH-110817) (GH-110825) (cherry picked from commit 548ce0923b9ef93b1c1df59f8febc4bb3daff28a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-110549: Remove unused includes of <stddef.h> in _testcapi ↵Serhiy Storchaka2023-10-093-6/+0
| | | | | | | (GH-110552) (GH-110553) (cherry picked from commit 89df5b73d07872d554da60b455b46c98e01a022d) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-110525: Cover PySet_Add corner case with frozenset objects ↵Miss Islington (bot)2023-10-091-0/+37
| | | | | | | (GH-110544) (GH-110554) (cherry picked from commit ea39c877c0a8e7a717f2e4bf7d92a3a8780e67c0) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-110525: Add CAPI tests for set and frozenset objects (GH-110526). ↵Nikita Sobolev2023-10-092-0/+163
| | | | | (GH-110547) (cherry picked from commit c49edd7d9c5395a6a6696a4846f56bc8b2b22792)
* [3.12] gh-109469: Silence compiler warnings on string comparisons in ↵Miss Islington (bot)2023-10-021-1/+2
| | | | | | | | _testcapi (GH-109533) (#109558) gh-109469: Silence compiler warnings on string comparisons in _testcapi (GH-109533) (cherry picked from commit ed582a2ed980efba2d0da365ae37bff4a2b99873) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] C API tests: use special markers to test that output parameters were ↵Serhiy Storchaka2023-09-085-20/+44
| | | | | | set (GH-109014) (#109023) [3.12] C API tests: use special markers to test that output parameters were set (GH-109014). (cherry picked from commit bf414b7fcb7c8ba780a5e1d9f320ecef0c7f9488)
* [3.12] Add Modules/_testcapi/util.h header (GH-108774) (#108780)Miss Islington (bot)2023-09-025-77/+46
| | | | | | | | Add Modules/_testcapi/util.h header (GH-108774) It contains common macros used in C API tests. (cherry picked from commit 0e01fac315dfa705ac8a6954485546f28cf4c87d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-107915: Handle errors in C API functions PyErr_Set*() and ↵Miss Islington (bot)2023-08-202-1/+105
| | | | | | | | | | | | | | | | | | | | PyErr_Format() (GH-107918) (#108134) * gh-107915: Handle errors in C API functions PyErr_Set*() and PyErr_Format() (GH-107918) Such C API functions as PyErr_SetString(), PyErr_Format(), PyErr_SetFromErrnoWithFilename() and many others no longer crash or ignore errors if it failed to format the error message or decode the filename. Instead, they keep a corresponding error. (cherry picked from commit 633ea217a85f6b6ba5bdbc73094254d5811b3485) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> * Define PY_SSIZE_T_CLEAN. --------- Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-107178: Add the C API tests for the Abstract Objects Layer ↵Serhiy Storchaka2023-08-163-0/+860
| | | | | | | | | | | | (GH-107179) (#107728) Cover all the Mapping Protocol, almost all the Sequence Protocol (except PySequence_Fast) and a part of the Object Protocol. Move existing tests to Lib/test/test_capi/test_abstract.py and Modules/_testcapi/abstract.c. Add also tests for PyDict C API.. (cherry picked from commit 16c9415fba4972743f1944ebc44946e475e68bc4)
* [3.12] gh-91054: make code watcher tests resilient to other watchers ↵Miss Islington (bot)2023-08-111-3/+11
| | | | | | | | (GH-107821) (#107835) gh-91054: make code watcher tests resilient to other watchers (GH-107821) (cherry picked from commit 2ec16fed14aae896e38dd5bd9e73e2eddc974439) Co-authored-by: Carl Meyer <carl@oddbird.net>
* [3.12] gh-47146: Fix reference counting in _testcapi.structmember ↵Miss Islington (bot)2023-07-211-1/+1
| | | | | | | initializer (GH-106862) (GH-106953) (cherry picked from commit 8d397ee8259fa0f81598a452438fc335267ca260) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-99593: Add tests for Unicode C API (part 3) (GH-104728) (GH-106595)Serhiy Storchaka2023-07-101-1/+506
| | | | Add tests for codecs. (cherry picked from commit 51ea664d18938645521bdd128a3c55f9c197644c)
* [3.12] gh-91053: make func watcher tests resilient to other func watchers ↵Miss Islington (bot)2023-07-031-12/+11
| | | | | | | | (GH-106286) (#106365) gh-91053: make func watcher tests resilient to other func watchers (GH-106286) (cherry picked from commit 58906213cc5d8f2be311664766b4923ef29dae1f) Co-authored-by: Carl Meyer <carl@oddbird.net>
* [3.12] gh-106033: Get rid of new occurrences of PyDict_GetItem and Py… ↵Serhiy Storchaka2023-06-241-1/+1
| | | | | | | | | | (#106041) [3.12] gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_HasAttr (GH-106034) These functions are broken by design because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. They should not be used in new code. (cherry picked from commit 1d33d5378058671bfabb6f4d4b5bfd4726973ff9)
* [3.12] gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL ↵Miss Islington (bot)2023-06-121-0/+13
| | | | | | | | (GH-105386) (GH-105697) gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386) (cherry picked from commit 2b90796be6959d5ef46b38c434a514fce25be971) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.12] gh-105375: Harden error handling in `_testcapi/heaptype.c` ↵Miss Islington (bot)2023-06-091-1/+4
| | | | | | | | (GH-105608) (#105615) Bail on first error in heapctypesubclasswithfinalizer_finalize() (cherry picked from commit d636d7dfe714e7168b342c7ea5f9f9d3b3569ed0) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.12] gh-105071: add PyUnstable_Exc_PrepReraiseStar to expose except* ↵Irit Katriel2023-05-302-1/+49
| | | | | implementation in the unstable API (GH-105072) (#105095) (cherry picked from commit b7aadb4583b040ddc8564896b91f4e5e571c82d6)
* gh-98836: Extend PyUnicode_FromFormat() (GH-98838)Serhiy Storchaka2023-05-211-15/+48
| | | | | | | | | * Support for conversion specifiers o (octal) and X (uppercase hexadecimal). * Support for length modifiers j (intmax_t) and t (ptrdiff_t). * Length modifiers are now applied to all integer conversions. * Support for wchar_t C strings (%ls and %lV). * Support for variable width and precision (*). * Support for flag - (left alignment).
* GH-101291: Add low level, unstable API for pylong (GH-101685)Mark Shannon2023-05-211-0/+13
| | | Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-104469: Convert _testcapi/exceptions to use AC (gh-104502)Dong-hee Na2023-05-212-97/+531
|
* gh-104469: Update README.txt for _testcapi (gh-104529)Dong-hee Na2023-05-171-0/+7
| | | | | | * gh-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>
* gh-104469: Convert _testcapi/watchers.c to use Argument Clinic (#104503)Nikita Sobolev2023-05-152-43/+259
| | | | | | | | | | Remove boilerplate code by converting the following functions: - _testcapi.watch_dict - _testcapi.unwatch_dict - _testcapi.watch_type - _testcapi.unwatch_type - _testcapi.set_func_defaults_via_capi - _testcapi.set_func_kwdefaults_via_capi
* gh-104469 Convert _testcapi/float.c to use AC (gh-104470)Dong-hee Na2023-05-152-19/+123
|
* gh-93649: Split gc- and allocation tests from _testcapimodule.c (GH-104403)Jurica Bradarić2023-05-122-0/+345
|
* Trim trailing whitespace and test on CI (#104275)Hugo van Kemenade2023-05-081-1/+1
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-99593: Add tests for Unicode C API (part 2) (#99868)Serhiy Storchaka2023-05-041-27/+479
| | | | | Add tests for lower-level functions. Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
* gh-102500: Implement PEP 688 (#102521)Jelle Zijlstra2023-05-042-0/+103
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-103509: PEP 697 -- Limited C API for Extending Opaque Types (GH-103511)Petr Viktorin2023-05-043-1/+474
| | | | Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-103968: Deprecate creating heap types whose metaclass has custom tp_new. ↵Petr Viktorin2023-05-031-1/+15
| | | | | | | | (GH-103972) (That's a mouthful of an edge case!) Co-authored-by: Barney Gale <barney.gale@gmail.com>
* gh-84436: Add integration C API tests for immortal objects (gh-103962)Dong-hee Na2023-05-022-0/+48
|
* Fix typos in faulthandler, testcapi error messages (#103020)Liyang Zhang2023-03-251-2/+2
|
* GH-101291: Rearrange the size bits in PyLongObject (GH-102464)Mark Shannon2023-03-221-1/+1
| | | | | | | | | | * Eliminate all remaining uses of Py_SIZE and Py_SET_SIZE on PyLongObject, adding asserts. * Change layout of size/sign bits in longobject to support future addition of immortal ints and tagged medium ints. * Add functions to hide some internals of long object, and for setting sign and digit count. * Replace uses of IS_MEDIUM_VALUE macro with _PyLong_IsCompact().
* GH-94808: Cover `PyOS_mystrnicmp` and `PyOS_mystricmp` (gh-102469)Artem Mukhin2023-03-222-0/+61
|
* gh-102755: PyErr_DisplayException only in ABI >= 3.12. Tests cover ↵Irit Katriel2023-03-211-3/+13
| | | | PyErr_Display as well (GH-102849)
* gh-102755: Add PyErr_DisplayException(exc) (#102756)Irit Katriel2023-03-161-10/+3
|