Miss Islington (bot)
8f43250c91
[3.12] Add more C API tests (GH-112522) (GH-112525)
...
Add tests for PyObject_Str(), PyObject_Repr(), PyObject_ASCII() and
PyObject_Bytes().
(cherry picked from commit e0449b9a7f )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-29 22:02:57 +02:00
Miss Islington (bot)
e28722e772
[3.12] gh-109802: Increase test coverage for complexobject.c (GH-112452) (GH-112489)
...
(cherry picked from commit f14d741daa )
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2023-11-28 08:33:44 +00:00
Miss Islington (bot)
46047bb12b
[3.12] gh-112438: Fix support of format units with the "e" prefix in nested tuples in PyArg_Parse (gh-112439) (GH-112460)
...
(cherry picked from commit 4eea1e8236 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-27 17:57:30 +00:00
Miss Islington (bot)
759168a2a9
[3.12] gh-111495: Add tests for PyList C API (GH-111562) (GH-111861)
...
(cherry picked from commit a3903c8ec8 )
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>
2023-11-08 18:10:13 +00:00
Miss Islington (bot)
e0c2bf4672
[3.12] gh-111495: Add tests for PyComplex C API (GH-111591) (GH-111753)
...
(cherry picked from commit 24b5cbd3dc )
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2023-11-05 08:12:57 +00:00
Miss Islington (bot)
fef32a1d08
[3.12] gh-111495: Add tests for PyFloat C API (GH-111624) (GH-111752)
...
(cherry picked from commit b452202a11 )
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2023-11-05 10:01:31 +02:00
Miss Islington (bot)
f1087855e2
[3.12] gh-111495: Add tests for PyBytes and PyByteArray C API (GH-111496) (GH-111607)
...
(cherry picked from commit 97b3cd38d1 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-01 18:23:39 +00:00
Sergey B Kirpichev
9619e517d4
[3.12] gh-111495: add stub files for C API test modules (GH-111586) (GH-111592)
...
This is to reduce merge conflicts (Modules/Setup.stdlib.in) for
subsequent pull requests for the issue.
(cherry picked from commit 33ed5fa69d )
2023-11-01 09:43:56 +02:00
Miss Islington (bot)
748bc48648
[3.12] gh-108082: C API: Add tests for PyErr_WriteUnraisable() (GH-111455) (GH-111507)
...
Also document the behavior when called with NULL.
(cherry picked from commit bca3305429 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-30 17:36:00 +00:00
Serhiy Storchaka
54e93d36d0
[3.12] gh-111065: Add more tests for the C API with the PySys_ prefix (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 b2ba298527 )
2023-10-25 09:10:03 +00:00
Miss Islington (bot)
552ceb2d0f
[3.12] gh-110572: Fix potential leaks in test_*_code in _testcapi/getargs.c (GH-110573) (GH-111161)
...
(cherry picked from commit f71cd5394e )
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-21 12:57:22 +00:00
Serhiy Storchaka
7c3e8e5af0
[3.12] gh-110628: Add tests for PyLong C API (GH-110629) (GH-110854)
...
(cherry picked from commit 9d40ebf190 )
2023-10-14 10:20:24 +03:00
Miss Islington (bot)
1c44f881c7
[3.12] gh-110815: Improve tests for PyArg_ParseTupleAndKeywords() (GH-110817) (GH-110825)
...
(cherry picked from commit 548ce0923b )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-13 13:41:43 +00:00
Serhiy Storchaka
5afac0cf8d
[3.12] gh-110549: Remove unused includes of <stddef.h> in _testcapi (GH-110552) (GH-110553)
...
(cherry picked from commit 89df5b73d0 )
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-09 11:43:35 +00:00
Miss Islington (bot)
b2419eff95
[3.12] gh-110525: Cover PySet_Add corner case with frozenset objects (GH-110544) (GH-110554)
...
(cherry picked from commit ea39c877c0 )
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-09 11:40:53 +00:00
Nikita Sobolev
3ed5cb0de3
[3.12] gh-110525: Add CAPI tests for set and frozenset objects (GH-110526). (GH-110547)
...
(cherry picked from commit c49edd7d9c )
2023-10-09 10:04:09 +00:00
Miss Islington (bot)
ddc0adcdb3
[3.12] gh-109469: Silence compiler warnings on string comparisons in _testcapi (GH-109533) ( #109558 )
...
gh-109469: Silence compiler warnings on string comparisons in _testcapi (GH-109533)
(cherry picked from commit ed582a2ed9 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-02 16:59:43 +02:00
Serhiy Storchaka
e65401d245
[3.12] C API tests: use special markers to test that output parameters were 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 bf414b7fcb )
2023-09-08 15:09:49 +02:00
Miss Islington (bot)
ba7e06bb63
[3.12] Add Modules/_testcapi/util.h header (GH-108774) ( #108780 )
...
Add Modules/_testcapi/util.h header (GH-108774)
It contains common macros used in C API tests.
(cherry picked from commit 0e01fac315 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-02 23:43:14 +02:00
Miss Islington (bot)
97d67e9dab
[3.12] gh-107915: Handle errors in C API functions PyErr_Set*() and 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 633ea217a8 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Define PY_SSIZE_T_CLEAN.
---------
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-08-20 23:07:24 +02:00
Serhiy Storchaka
9c8dfcec64
[3.12] gh-107178: Add the C API tests for the Abstract Objects Layer (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 16c9415fba )
2023-08-16 14:29:08 +02:00
Miss Islington (bot)
98dd9d9725
[3.12] gh-91054: make code watcher tests resilient to other watchers (GH-107821) ( #107835 )
...
gh-91054: make code watcher tests resilient to other watchers (GH-107821)
(cherry picked from commit 2ec16fed14 )
Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-08-11 16:13:14 +02:00
Miss Islington (bot)
4be0f157ea
[3.12] gh-47146: Fix reference counting in _testcapi.structmember initializer (GH-106862) (GH-106953)
...
(cherry picked from commit 8d397ee825 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-21 14:48:50 +03:00
Serhiy Storchaka
2da967ea14
[3.12] gh-99593: Add tests for Unicode C API (part 3) (GH-104728) (GH-106595)
...
Add tests for codecs.
(cherry picked from commit 51ea664d18 )
2023-07-10 20:58:58 +03:00
Miss Islington (bot)
887a7e6036
[3.12] gh-91053: make func watcher tests resilient to other func watchers (GH-106286) ( #106365 )
...
gh-91053: make func watcher tests resilient to other func watchers (GH-106286)
(cherry picked from commit 58906213cc )
Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-07-03 09:13:21 -06:00
Serhiy Storchaka
9cd366462b
[3.12] gh-106033: Get rid of new occurrences of PyDict_GetItem and Py… ( #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 1d33d53780 )
2023-06-24 16:36:34 -07:00
Miss Islington (bot)
2eed1f5868
[3.12] gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386) (GH-105697)
...
gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386)
(cherry picked from commit 2b90796be6 )
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2023-06-12 16:24:21 +00:00
Miss Islington (bot)
4fbbf699c0
[3.12] gh-105375: Harden error handling in _testcapi/heaptype.c (GH-105608) ( #105615 )
...
Bail on first error in heapctypesubclasswithfinalizer_finalize()
(cherry picked from commit d636d7dfe7 )
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-09 23:21:42 +00:00
Irit Katriel
b45df737d4
[3.12] gh-105071: add PyUnstable_Exc_PrepReraiseStar to expose except* implementation in the unstable API (GH-105072) ( #105095 )
...
(cherry picked from commit b7aadb4583 )
2023-05-30 16:50:23 +01:00
Serhiy Storchaka
f3466bc040
gh-98836: Extend PyUnicode_FromFormat() (GH-98838)
...
* 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).
2023-05-22 00:32:39 +03:00
Mark Shannon
93923793f6
GH-101291: Add low level, unstable API for pylong (GH-101685)
...
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2023-05-21 14:45:48 +01:00
Dong-hee Na
2e91c7e626
gh-104469: Convert _testcapi/exceptions to use AC (gh-104502)
2023-05-21 18:39:45 +09:00
Dong-hee Na
b58bc8c2a9
gh-104469: Update README.txt for _testcapi (gh-104529)
...
* 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>
2023-05-17 12:56:20 +09:00
Nikita Sobolev
456d56698d
gh-104469: Convert _testcapi/watchers.c to use Argument Clinic ( #104503 )
...
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
2023-05-15 22:59:41 +02:00
Dong-hee Na
48b3617de4
gh-104469 Convert _testcapi/float.c to use AC (gh-104470)
2023-05-15 12:44:00 +09:00
Jurica Bradarić
19ee53d52e
gh-93649: Split gc- and allocation tests from _testcapimodule.c (GH-104403)
2023-05-12 10:26:07 +01:00
Hugo van Kemenade
d513ddee94
Trim trailing whitespace and test on CI ( #104275 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-08 17:03:52 +03:00
Serhiy Storchaka
2ba931ff72
gh-99593: Add tests for Unicode C API (part 2) ( #99868 )
...
Add tests for lower-level functions.
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-05-04 15:25:09 +00:00
Jelle Zijlstra
04f6733275
gh-102500: Implement PEP 688 ( #102521 )
...
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-05-04 07:59:46 -07:00
Petr Viktorin
cd9a56c2b0
gh-103509: PEP 697 -- Limited C API for Extending Opaque Types (GH-103511)
...
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-05-04 09:56:53 +02:00
Petr Viktorin
524a7f77fd
gh-103968: Deprecate creating heap types whose metaclass has custom tp_new. (GH-103972)
...
(That's a mouthful of an edge case!)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
2023-05-03 15:17:14 +02:00
Dong-hee Na
d81ca7ec02
gh-84436: Add integration C API tests for immortal objects (gh-103962)
2023-05-03 00:05:30 +09:00
Liyang Zhang
11ed70b1dc
Fix typos in faulthandler, testcapi error messages ( #103020 )
2023-03-25 14:27:02 -07:00
Mark Shannon
7559f5fda9
GH-101291: Rearrange the size bits in PyLongObject (GH-102464)
...
* 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().
2023-03-22 14:49:51 +00:00
Artem Mukhin
0a60deaeaf
GH-94808: Cover PyOS_mystrnicmp and PyOS_mystricmp (gh-102469)
2023-03-22 20:35:27 +09:00
Irit Katriel
5c471f3f2a
gh-102755: PyErr_DisplayException only in ABI >= 3.12. Tests cover PyErr_Display as well (GH-102849)
2023-03-21 10:36:18 +01:00
Irit Katriel
3f9285a8c5
gh-102755: Add PyErr_DisplayException(exc) ( #102756 )
2023-03-16 22:18:04 +00:00
Irit Katriel
51d693c584
gh-102594: PyErr_SetObject adds note to exception raised on normalization error ( #102675 )
2023-03-16 10:16:01 +00:00
Carl Meyer
1e703a4733
gh-102381: don't call watcher callback with dead object ( #102382 )
...
Co-authored-by: T. Wouters <thomas@python.org>
2023-03-07 17:10:58 -07:00
Irit Katriel
a33ca2ad1f
gh-102493: fix normalization in PyErr_SetObject ( #102502 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-03-07 13:27:46 -08:00