summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_call.py
Commit message (Collapse)AuthorAgeFilesLines
* GH-98686: Quicken everything (GH-98687)Brandt Bucher2022-11-021-5/+5
|
* gh-98586: Add vector call APIs to the Limited API (GH-98587)Wenzel Jakob2022-10-271-1/+33
| | | Expose the facilities for making vector calls through Python's limited API.
* gh-91058: Add error suggestions to 'import from' import errors (#98305)Pablo Galindo Salgado2022-10-251-2/+2
|
* GH-91079: Decouple C stack overflow checks from Python recursion checks. ↵Mark Shannon2022-10-051-0/+38
| | | | (GH-96510)
* GH-91049: Introduce set vectorcall field API for PyFunctionObject (GH-92257)adphrost2022-09-151-0/+51
| | | | 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-171-4/+2
| | | | | | | | | | | | | (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.)
* Disable Limited API tests with Py_TRACE_REFS (GH-95796)Petr Viktorin2022-08-091-0/+4
|
* gh-93274: Expose receiving vectorcall in the Limited API (GH-95717)Petr Viktorin2022-08-081-0/+5
|
* gh-93274: Make vectorcall safe on mutable classes & inherit it by default ↵Petr Viktorin2022-08-041-1/+63
| | | | (#95437)
* gh-94938: Fix test (GH-95396)Serhiy Storchaka2022-07-301-5/+0
|
* gh-94938: Fix errror detection of unexpected keyword arguments (GH-94999)Serhiy Storchaka2022-07-281-0/+25
| | | | | | | | | | When keyword argument name is an instance of a str subclass with overloaded methods __eq__ and __hash__, the former code could not find the name of an extraneous keyword argument to report an error, and _PyArg_UnpackKeywords() returned success without setting the corresponding cell in the linearized arguments array. But since the number of expected initialized cells is determined as the total number of passed arguments, this lead to reading NULL as a keyword parameter value, that caused SystemError or crash or other undesired behavior.
* GH-93252: Fix error handling for failed Python calls (GH-94693)Brandt Bucher2022-07-091-0/+12
|
* bpo-45155 : Default arguments for int.to_bytes(length=1, ↵Barry Warsaw2021-09-161-1/+1
| | | | | | | byteorder=sys.byteorder) (#28265) Add default arguments for int.to_bytes() and int.from_bytes() Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* bpo-20201: variadic arguments support for AC (GH-18609)Batuhan Taskaya2021-07-161-1/+1
| | | Implement support for `*args` in AC, and port `print()` to use it.
* bpo-43908: Immutable types inherit vectorcall (GH-27001)Erlend Egeberg Aasland2021-07-081-2/+2
| | | | | | Heap types with the Py_TPFLAGS_IMMUTABLETYPE flag can now inherit the PEP 590 vectorcall protocol. Previously, this was only possible for static types. Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40679: Use the function's qualname in certain TypeErrors (GH-20236)Dennis Sweeney2020-05-221-0/+48
| | | | Patch by Dennis Sweeney.
* bpo-40443: Remove unused imports in tests (GH-19804)Victor Stinner2020-04-301-1/+0
|
* bpo-39245: Switch to public API for Vectorcall (GH-18460)Petr Viktorin2020-02-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The bulk of this patch was generated automatically with: for name in \ PyObject_Vectorcall \ Py_TPFLAGS_HAVE_VECTORCALL \ PyObject_VectorcallMethod \ PyVectorcall_Function \ PyObject_CallOneArg \ PyObject_CallMethodNoArgs \ PyObject_CallMethodOneArg \ ; do echo $name git grep -lwz _$name | xargs -0 sed -i "s/\b_$name\b/$name/g" done old=_PyObject_FastCallDict new=PyObject_VectorcallDict git grep -lwz $old | xargs -0 sed -i "s/\b$old\b/$new/g" and then cleaned up: - Revert changes to in docs & news - Revert changes to backcompat defines in headers - Nudge misaligned comments
* bpo-37645: add new function _PyObject_FunctionStr() (GH-14890)Jeroen Demeyer2019-11-051-5/+5
| | | | | | | | | | | | Additional note: the `method_check_args` function in `Objects/descrobject.c` is written in such a way that it applies to all kinds of descriptors. In particular, a future re-implementation of `wrapper_descriptor` could use that code. CC @vstinner @encukou https://bugs.python.org/issue37645 Automerge-Triggered-By: @encukou
* bpo-37499: Test various C calling conventions (GH-15776)Petr Viktorin2019-09-101-164/+221
| | | | | | | | | | Add functions with various calling conventions to `_testcapi`, expose them as module-level functions, bound methods, class methods, and static methods, and test calling them and introspecting them through GDB. https://bugs.python.org/issue37499 Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be> Automerge-Triggered-By: @pganssle
* bpo-36974: separate vectorcall functions for each calling convention (GH-13781)Jeroen Demeyer2019-07-051-0/+2
|
* bpo-36974: inherit tp_vectorcall_offset unconditionally (GH-13858)Jeroen Demeyer2019-06-241-0/+9
|
* bpo-37191: Move TestPEP590 from test_capi to test_call (GH-13892)Victor Stinner2019-06-071-0/+123
|
* bpo-36974: implement PEP 590 (GH-13185)Jeroen Demeyer2019-05-291-8/+8
| | | | | Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be> Co-authored-by: Mark Shannon <mark@hotpy.org>
* bpo-36907: fix refcount bug in _PyStack_UnpackDict() (GH-13381)Jeroen Demeyer2019-05-221-0/+17
|
* bpo-36282: Improved error message for too much positional arguments. (GH-12310)Serhiy Storchaka2019-03-131-1/+1
|
* bpo-34193: Fix pluralization in getargs.c and test cases. (GH-8438)Xtreak2018-12-211-4/+7
|
* bpo-34320: Fix dict(o) didn't copy order of dict subclass (GH-8624)INADA Naoki2018-09-261-0/+17
| | | | | | | When dict subclass overrides order (`__iter__()`, `keys()`, and `items()`), `dict(o)` should use it instead of dict ordering. https://bugs.python.org/issue34320
* bpo-34127: Fix grammar in error message with respect to argument count (GH-8395)Xtreak2018-07-221-0/+16
|
* bpo-31229: Fixed wrong error messages when too many keyword arguments are ↵Oren Milman2017-08-231-0/+21
| | | | received. (#3180)
* bpo-30878: Fix error message when keyword arguments are passed (#2635)Sylvain2017-07-091-0/+8
| | | to staticmethod() and classmethod().
* bpo-20627: Fix error message when keyword arguments are used (#2115)Sylvain2017-06-151-0/+26
|
* bpo-30600: Fix error messages (condition order in Argument Clinic) (#2051)Sylvain2017-06-101-0/+12
| | | | | | | | The function '_PyArg_ParseStack()' and '_PyArg_UnpackStack' were failing (with error "XXX() takes Y argument (Z given)") before the function '_PyArg_NoStackKeywords()' was called. Thus, the latter did not raise its more meaningful error : "XXX() takes no keyword arguments".
* Fix regression in error message introduced in bpo-29951. (#2028)Serhiy Storchaka2017-06-091-0/+4
| | | | | | | | * Fix regression in error message introduced in bpo-29951. * Add test. * Make the test more strong.
* bpo-30524: Write unit tests for FASTCALL (#2022)Victor Stinner2017-06-091-0/+175
| | | | | | | Test C functions: * _PyObject_FastCall() * _PyObject_FastCallDict() * _PyObject_FastCallKeywords()
* bpo-30534: Fixed error messages when pass keyword arguments (#1901)Serhiy Storchaka2017-06-061-3/+57
| | | | | | | to functions implemented in C that don't support this. Also unified error messages for functions that don't take positional or keyword arguments.
* Issue #21741: Update 147 test modules to use test discovery.Zachary Ware2015-04-131-6/+1
| | | | | | | I have compared output between pre- and post-patch runs of these tests to make sure there's nothing missing and nothing broken, on both Windows and Linux. The only differences I found were actually tests that were previously *not* run.
* #2621 rename test.test_support to test.supportBenjamin Peterson2008-05-201-2/+2
|
* Get rid of dict.has_key(). Boy this has a lot of repercussions!Guido van Rossum2006-08-181-9/+9
| | | | | | Not all code has been fixed yet; this is just a checkpoint... The C API still has PyDict_HasKey() and _HasKeyString(); not sure if I want to change those just yet.
* SF #904720: dict.update should take a 2-tuple sequence like dict.__init_Raymond Hettinger2004-03-041-9/+9
| | | | | | | | (Championed by Bob Ippolito.) The update() method for mappings now accepts all the same argument forms as the dict() constructor. This includes item lists and/or keyword arguments.
* Combine the functionality of test_support.run_unittest()Walter Dörwald2003-05-011-2/+2
| | | | | | | | | | and test_support.run_classtests() into run_unittest() and use it wherever possible. Also don't use "from test.test_support import ...", but "from test import test_support" in a few spots. From SF patch #662807.
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-1/+1
| | | | | | | | | | | imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
* Change the PyUnit-based tests to use the test_main() approach. ThisFred Drake2001-09-201-1/+7
| | | | | allows using the tests with unittest.py as a script. The tests will still run when run as a script themselves.
* Variety of test cases for call to builtin functionsJeremy Hylton2001-05-291-0/+125