summaryrefslogtreecommitdiff
path: root/Modules/_testcapi
Commit message (Collapse)AuthorAgeFilesLines
* 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-032-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
|
* gh-102594: PyErr_SetObject adds note to exception raised on normalization ↵Irit Katriel2023-03-161-0/+21
| | | | error (#102675)
* gh-102381: don't call watcher callback with dead object (#102382)Carl Meyer2023-03-071-1/+12
| | | Co-authored-by: T. Wouters <thomas@python.org>
* gh-102493: fix normalization in PyErr_SetObject (#102502)Irit Katriel2023-03-071-0/+15
| | | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-101101: Fix test_code_extra to reset value for refleak test (gh-102350)Dong-hee Na2023-03-021-1/+5
|
* gh-101101: Unstable C API tier (PEP 689) (GH-101102)Petr Viktorin2023-02-282-0/+116
|
* gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives ↵Irit Katriel2023-02-242-12/+9
| | | | (in Modules/) (#102196)
* gh-93649: Split exception tests from _testcapimodule.c (GH-102173)Erlend E. Aasland2023-02-232-0/+278
| | | Automerge-Triggered-By: GH:erlend-aasland
* GH-101578: Normalize the current exception (GH-101607)Mark Shannon2023-02-081-9/+15
| | | | | | | | | | * Make sure that the current exception is always normalized. * Remove redundant type and traceback fields for the current exception. * Add new API functions: PyErr_GetRaisedException, PyErr_SetRaisedException * Add new API functions: PyException_GetArgs, PyException_SetArgs
* gh-93649: Split tracemalloc tests from _testcapimodule.c (#99551)Erlend E. Aasland2022-12-171-0/+81
|
* gh-99240: Reset pointer to NULL when the pointed memory is freed in argument ↵colorfulappl2022-12-171-0/+19
| | | | | | parsing (#99890) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* GH-100000: Cleanup and polish various watchers code (GH-99998)Itamar Ostricher2022-12-141-2/+4
| | | | | | * Initialize `type_watchers` array to `NULL`s * Optimize code watchers notification * Optimize func watchers notification
* GH-91054: Reset static events counts in code watchers tests (#99978)Itamar Ostricher2022-12-041-0/+9
|
* GH-91054: Add code object watchers API (GH-99859)Itamar Ostricher2022-12-021-0/+131
| | | | | | * Add API to allow extensions to set callback function on creation and destruction of PyCodeObject Co-authored-by: Ye11ow-Flash <janshah@cs.stonybrook.edu>
* gh-99612: Fix PyUnicode_DecodeUTF8Stateful() for ASCII-only data (GH-99613)Serhiy Storchaka2022-12-011-0/+36
| | | | Previously *consumed was not set in this case.
* gh-99593: Add tests for Unicode C API (part 1) (GH-99651)Serhiy Storchaka2022-11-291-6/+332
| | | | Add tests for functions corresponding to the str class methods.
* gh-91053: Add an optional callback that is invoked whenever a function is ↵mpage2022-11-221-0/+237
| | | | modified (#98175)
* gh-99537: Use Py_SETREF() function in longobject C code (#99655)Victor Stinner2022-11-221-8/+4
| | | | Replace "Py_DECREF(var); var = new;" with "Py_SETREF(var, new);" in longobject.c and _testcapi/long.c.
* gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h ↵Petr Viktorin2022-11-222-0/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-99014) The ``structmember.h`` header is deprecated, though it continues to be available and there are no plans to remove it. There are no deprecation warnings. Old code can stay unchanged (unless the extra include and non-namespaced macros bother you greatly). Specifically, no uses in CPython are updated -- that would just be unnecessary churn. The ``structmember.h`` header is deprecated, though it continues to be available and there are no plans to remove it. Its contents are now available just by including ``Python.h``, with a ``Py`` prefix added if it was missing: - `PyMemberDef`, `PyMember_GetOne` and`PyMember_SetOne` - Type macros like `Py_T_INT`, `Py_T_DOUBLE`, etc. (previously ``T_INT``, ``T_DOUBLE``, etc.) - The flags `Py_READONLY` (previously ``READONLY``) and `Py_AUDIT_READ` (previously all uppercase) Several items are not exposed from ``Python.h``: - `T_OBJECT` (use `Py_T_OBJECT_EX`) - `T_NONE` (previously undocumented, and pretty quirky) - The macro ``WRITE_RESTRICTED`` which does nothing. - The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of `Py_AUDIT_READ`. - In some configurations, ``<stddef.h>`` is not included from ``Python.h``. It should be included manually when using ``offsetof()``. The deprecated header continues to provide its original contents under the original names. Your old code can stay unchanged, unless the extra include and non-namespaced macros bother you greatly. There is discussion on the issue to rename `T_PYSSIZET` to `PY_T_SSIZE` or similar. I chose not to do that -- users will probably copy/paste that with any spelling, and not renaming it makes migration docs simpler. Co-Authored-By: Alexander Belopolsky <abalkin@users.noreply.github.com> Co-Authored-By: Matthias Braun <MatzeB@users.noreply.github.com>
* gh-93649: Split float/long tests from _testcapimodule.c (GH-99549)Erlend E. Aasland2022-11-174-0/+867
| | | Automerge-Triggered-By: GH:erlend-aasland
* gh-93649: Split watcher API tests from _testcapimodule.c (#99532)Erlend E. Aasland2022-11-162-0/+303
|
* gh-93649: Split memory and docstring tests from _testcapimodule.c (#99517)Erlend E. Aasland2022-11-163-0/+752
|
* gh-99300: Replace Py_INCREF() with Py_NewRef() (#99513)Victor Stinner2022-11-161-4/+2
| | | | Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef().
* gh-93649: Split pytime and datetime tests from _testcapimodule.c (#99494)Erlend E. Aasland2022-11-153-0/+729
|
* gh-93649: Split getargs tests from _testcapimodule.c (#99346)Erlend E. Aasland2022-11-142-0/+921
|
* gh-99300: Use Py_NewRef() in Modules/ directory (#99440)Victor Stinner2022-11-131-6/+3
| | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in test C files of the Modules/ directory.
* gh-98586: Add vector call APIs to the Limited API (GH-98587)Wenzel Jakob2022-10-271-4/+101
| | | Expose the facilities for making vector calls through Python's limited API.
* gh-94808: Cover `PyUnicode_Count` in CAPI (#96929)Nikita Sobolev2022-10-061-0/+21
|
* GH-91049: Introduce set vectorcall field API for PyFunctionObject (GH-92257)adphrost2022-09-151-0/+19
| | | | Co-authored-by: Andrew Frost <adfrost@fb.com> Co-authored-by: Itamar Ostricher <itamarost@gmail.com>
* gh-95991: Add some infrastructure for testing Limited API in _testcapi ↵Petr Viktorin2022-08-172-16/+33
| | | | | | | | | | | | | (GH-95992) - Limited API needs to be enabled per source file - Some builds don't support Limited API, so Limited API tests must be skipped on those builds (currently this is `Py_TRACE_REFS`, but that may change.) - `Py_LIMITED_API` must be defined before `<Python.h>` is included. This puts the hoop-jumping in `testcapi/parts.h`, so individual test files can be relatively simple. (Currently that's only `vectorcall_limited.c`, imagine more.)
* GH-95245: Move weakreflist into the pre-header. (GH-95996)Mark Shannon2022-08-161-0/+32
|
* gh-95707: Fix function signature (GH-95995)Christian Heimes2022-08-151-1/+2
|
* GH-95707: Fix uses of `Py_TPFLAGS_MANAGED_DICT` (GH-95854)Mark Shannon2022-08-151-0/+45
| | | | | | * Make sure that tp_dictoffset is correct with Py_TPFLAGS_MANAGED_DICT is set. * Avoid traversing managed dict twice when subclassing class with Py_TPFLAGS_MANAGED_DICT set.
* gh-90928: Statically Initialize the Keywords Tuple in Clinic-Generated Code ↵Eric Snow2022-08-111-1/+7
| | | | | | | | | | | | | | | | (gh-95860) We only statically initialize for core code and builtin modules. Extension modules still create the tuple at runtime. We'll solve that part of interpreter isolation separately. This change includes generated code. The non-generated changes are in: * Tools/clinic/clinic.py * Python/getargs.c * Include/cpython/modsupport.h * Makefile.pre.in (re-generate global strings after running clinic) * very minor tweaks to Modules/_codecsmodule.c and Python/Python-tokenize.c All other changes are generated code (clinic, global strings).
* gh-95504: Fix negative numbers in PyUnicode_FromFormat (GH-95848)Petr Viktorin2022-08-101-0/+60
| | | Co-authored-by: philg314 <110174000+philg314@users.noreply.github.com>
* gh-93649: Undefine NDEBUG in Modules/_testcapi/* to enable assert() (GH-95793)Petr Viktorin2022-08-101-0/+3
|