summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_builtin.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-118899: Add tests for `NotImplemented` attribute access ↵Miss Islington (bot)2024-05-121-0/+18
| | | | | | | | (GH-118902) (#118969) gh-118899: Add tests for `NotImplemented` attribute access (GH-118902) (cherry picked from commit ec1398e117fb142cc830495503dbdbb1ddafe941) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-114552: Update `__dir__` method docs: it allows returning an ↵Miss Islington (bot)2024-02-101-0/+8
| | | | | | | | iterable (GH-114662) (#115234) gh-114552: Update `__dir__` method docs: it allows returning an iterable (GH-114662) (cherry picked from commit e19103a346f0277c44a43dfaebad9a5aa468bf1e) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-113896: Fix test_builtin.BuiltinTest.test___ne__() (GH-113897) ↵Miss Islington (bot)2024-01-101-2/+2
| | | | | | | | | | | | (#113928) gh-113896: Fix test_builtin.BuiltinTest.test___ne__() (GH-113897) Fix DeprecationWarning in test___ne__(). (cherry picked from commit 9d33c23857cfd952bf3e1e7f34c77b7c9a5accc3) Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru> Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-112716: Fix SystemError when __builtins__ is not a dict ↵Serhiy Storchaka2023-12-141-0/+26
| | | | | | | | | (GH-112770) (GH-113103) It was raised in two cases: * in the import statement when looking up __import__ * in pickling some builtin type when looking up built-ins iter, getattr, etc. (cherry picked from commit 1161c14e8c68296fc465cd48970b32be9bee012e)
* [3.12] gh-112125: Fix None.__ne__(None) returning NotImplemented instead of ↵Victor Stinner2023-12-071-0/+5
| | | | | | | | | … (#112827) gh-112125: Fix None.__ne__(None) returning NotImplemented instead of False (#112504) (cherry picked from commit 9c3458e05865093dd55d7608810a9d0ef0765978) Co-authored-by: andrewluotechnologies <44252973+andrewluotechnologies@users.noreply.github.com>
* [3.12] gh-112625: Protect bytearray from being freed by misbehaving iterator ↵Miss Islington (bot)2023-12-041-0/+17
| | | | | | | inside bytearray.join (GH-112626) (GH-112693) (cherry picked from commit 0e732d0997cff08855d98c17af4dd5527f10e419) Co-authored-by: chilaxan <chilaxan@gmail.com>
* [3.12] gh-110393: Remove watchdog with hardcoded timeout (GH-110400) (#110445)Miss Islington (bot)2023-10-051-2/+0
| | | | | | | | | | | | | gh-110393: Remove watchdog with hardcoded timeout (GH-110400) test_builtin and test_socketserver no longer use signal.alarm() to implement a watchdog with a hardcoded timeout (2 and 60 seconds). Python test runner regrtest has two watchdogs: faulthandler and timeout on running worker processes. Tests using short hardcoded timeout can fail on slowest buildbots just because the timeout is too short. (cherry picked from commit 1328fa31fe9c72748fc6fd11d017c82aafd48a49) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-108416: Mark slow test methods with @requires_resource('cpu') ↵Miss Islington (bot)2023-09-021-0/+1
| | | | | | | | | | | | (GH-108421) (#108798) gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421) Only mark tests which spend significant system or user time, by itself or in subprocesses. (cherry picked from commit f3ba0a74cd50274acdcd592d4ce8395b92492b7c) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-104600: Make type.__type_params__ writable (#104634)Jelle Zijlstra2023-05-191-0/+12
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* GH-104142: Fix _Py_RefcntAdd to respect immortality (GH-104143)Brandt Bucher2023-05-051-18/+25
|
* gh-84436: Implement Immortal Objects (gh-19474)Eddie Elizondo2023-04-221-1/+23
| | | | | | | | | This is the implementation of PEP683 Motivation: The PR introduces the ability to immortalize instances in CPython which bypasses reference counting. Tagging objects as immortal allows up to skip certain operations when we know that the object will be around for the entire execution of the runtime. Note that this by itself will bring a performance regression to the runtime due to the extra reference count checks. However, this brings the ability of having truly immutable objects that are useful in other contexts such as immutable data sharing between sub-interpreters.
* gh-102356: Add thrashcan macros to filter object dealloc (#102426)Marta Gómez Macías2023-03-051-0/+10
| | | Add thrashcan macros to the deallocator of the filter objects to protect against deeply nested destruction of chains of nested filters.
* GH-90829: Fix empty iterable error message in min/max (#31181)Nnarol2023-01-081-2/+10
|
* GH-100425: Improve accuracy of builtin sum() for float inputs (GH-100426)Raymond Hettinger2022-12-231-0/+18
|
* gh-99124: use concrete exception types in `test_builtin` (#99125)Nikita Sobolev2022-11-081-3/+3
|
* gh-94808: Cover `LOAD_GLOBAL` for custom dict subtypes (GH-96767)Nikita Sobolev2022-11-041-0/+31
|
* gh-96670: Raise SyntaxError when parsing NULL bytes (#97594)Pablo Galindo Salgado2022-09-271-2/+1
|
* gh-96197: Add `del sys.breakpointhook` behavior test (gh-96198)Jeong YunWon2022-08-231-0/+5
|
* GH-94808: Test __build_class__ inside non-dict __builtins__ (GH-95932)Michael Droettboom2022-08-151-5/+9
|
* gh-93124: Fix typos in comments (GH-93125)Akuli2022-05-251-1/+1
| | | | | Fixes #93124 Automerge-Triggered-By: GH:rhettinger
* gh-90473: Increase stack size, disable obmalloc on WASI (GH-92732)Christian Heimes2022-05-131-1/+4
|
* gh-92203: Add closure support to exec(). (#92204)larryhastings2022-05-061-1/+79
| | | Add a closure keyword-only parameter to exec(). It can only be specified when exec-ing a code object that uses free variables. When specified, it must be a tuple, with exactly the number of cell variables referenced by the code object. closure has a default value of None, and it must be None if the code object doesn't refer to any free variables.
* gh-91156: Use `locale.getencoding()` instead of getpreferredencoding (GH-91732)Inada Naoki2022-04-221-1/+1
| | | Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40280: Address more test failures on Emscripten (GH-31050)Christian Heimes2022-02-051-0/+2
| | | Co-authored-by: Brett Cannon <brett@python.org>
* bpo-44024: Improve the TypeError message in getattr and hasattr (GH-25863)Géry Ogam2022-01-181-4/+14
| | | | | | Use common error message for non-string attribute name in the builtin functions getattr and hasattr. The special check no longer needed since Python 3.0.
* bpo-46411: Remove unnecessary calls to sys.exc_info() in tests (GH-30638)Irit Katriel2022-01-181-2/+2
|
* bpo-13886: Skip PTY non-ASCII tests if readline is loaded (GH-30631)Victor Stinner2022-01-171-2/+14
| | | | | | | | | | Skip test_builtin PTY tests on non-ASCII characters if the readline module is loaded. The readline module changes input() behavior, but test_builtin is not intented to test the readline module. When the readline module is loaded, PyOS_Readline() uses the readline implementation. In some cases, the Python readline callback rlhandler() is called by readline with a string without non-ASCII characters.
* bpo-45346: Keep docs consistent regarding true and false values (GH-28697)Raymond Hettinger2021-10-021-1/+1
|
* bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25142)Inada Naoki2021-04-021-6/+8
| | | | | | | | | | | | | * test__xxsubinterpreters * test_builtin * test_doctest * test_exceptions * test_opcodes * test_support * test_argparse * test_baseexception * test_bdb * test_bool * test_asdl_parser
* bpo-40636: Remove overly-strict zip pickling tests (GH-24109)Brandt Bucher2021-01-051-42/+0
|
* bpo-42536: GC track recycled tuples (GH-23623)Brandt Bucher2020-12-051-0/+13
| | | | | | | | | | | | | | | | Several built-in and standard library types now ensure that their internal result tuples are always tracked by the garbage collector: - collections.OrderedDict.items - dict.items - enumerate - functools.reduce - itertools.combinations - itertools.combinations_with_replacement - itertools.permutations - itertools.product - itertools.zip_longest - zip Previously, they could have become untracked by a prior garbage collection.
* bpo-40275: Use new test.support helper submodules in tests (GH-21449)Hai Shi2020-08-031-3/+3
|
* bpo-41218: Improve the test cases for test_compile_top_level_await_no_coro ↵Pablo Galindo2020-07-061-3/+5
| | | | (GH-21363)
* bpo-41218: Only mark async code with CO_COROUTINE. (#21357)Matthias Bussonnier2020-07-061-0/+19
| | | | | 3.8.3 had a regression where compiling with ast.PyCF_ALLOW_TOP_LEVEL_AWAIT woudl agressively mark things are coroutine even if there were not.
* bpo-40636: PEP 618: add strict parameter to zip() (GH-20921)Guido van Rossum2020-06-191-0/+150
| | | | | | | | zip() now supports PEP 618's strict parameter, which raises a ValueError if the arguments are exhausted at different lengths. Patch by Brandt Bucher. Co-authored-by: Brandt Bucher <brandtbucher@gmail.com> Co-authored-by: Ram Rachum <ram@rachum.com>
* bpo-40140: test_builtin.PtyTests registers SIGHUP handler (GH-19314)Victor Stinner2020-04-021-5/+18
| | | | | | | | test_builtin.PtyTests now registers an handler for SIGHUP signal. Closing the PTY file descriptor can emit a SIGHUP signal: just ignore it. run_child() now also closes the PTY file descriptor before waiting for the process completition, otherwise the test hangs on AIX.
* bpo-31160: Fix race condition in test_os.PtyTests (GH-19263)Victor Stinner2020-03-311-2/+9
| | | | bpo-31160, bpo-40094: Wait until the process completes before closing the PTY to prevent sending SIGHUP to the child process.
* bpo-40094: Add test.support.wait_process() (GH-19254)Victor Stinner2020-03-311-1/+2
| | | | | | | | | Moreover, the following tests now check the child process exit code: * test_os.PtyTests * test_mailbox.test_lock_conflict() * test_tempfile.test_process_awareness() * test_uuid.testIssue8621() * multiprocessing resource tracker tests
* bpo-39562: Allow executing asynchronous comprehensions in the asyncio REPL ↵Batuhan Taşkaya2020-03-191-1/+8
| | | | | (GH-18968) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-39965: Correctly raise SyntaxError if await is used outside async ↵Pablo Galindo2020-03-151-0/+38
| | | | functions when PyCF_ALLOW_TOP_LEVEL_AWAIT is set (GH-19010)
* bpo-35712: Make using NotImplemented in a boolean context issue a ↵MojoVampire2020-03-031-0/+14
| | | | deprecation warning (GH-13195)
* bpo-39200: Correct the error message for min/max builtin function (GH-17814)Dong-hee Na2020-01-101-2/+12
| | | | Correct the error message when calling the min() or max() with no arguments.
* bpo-38839: Fix some unused functions in tests (GH-17189)Adam Johnson2019-11-191-0/+1
|
* bpo-38237: Make pow's arguments have more descriptive names and be keyword ↵Ammar Askar2019-09-211-0/+13
| | | | | | | | | | | | passable (GH-16302) Edit: `math.pow` changes removed on Mark's request. https://bugs.python.org/issue38237 Automerge-Triggered-By: @rhettinger
* Fix the ImportWarning regarding __spec__ and __package__ being None (GH-16003)Xtreak2019-09-121-3/+4
|
* bpo-37409: fix relative import with no parent (#14956)Ben Lewis2019-09-111-0/+4
| | | | | | | | | | | | | Relative imports use resolve_name to get the absolute target name, which first seeks the current module's absolute package name from the globals: If __package__ (and __spec__.parent) are missing then import uses __name__, truncating the last segment if the module is a submodule rather than a package __init__.py (which it guesses from whether __path__ is defined). The __name__ attempt should fail if there is no parent package (top level modules), if __name__ is '__main__' (-m entry points), or both (scripts). That is, if both __name__ has no subcomponents and the module does not seem to be a package __init__ module then import should fail.
* bpo-36781: Optimize sum() for bools. (#13074)Serhiy Storchaka2019-09-101-0/+21
| | | | | | | | * Optimize sum() for bools. * Fix sum([], False). * Add a NEWS entry.
* bpo-15999: Clean up of handling boolean arguments. (GH-15610)Serhiy Storchaka2019-09-011-3/+3
| | | | | | * Use the 'p' format unit instead of manually called PyObject_IsTrue(). * Pass boolean value instead 0/1 integers to functions that needs boolean. * Convert some arguments to boolean only once.
* bpo-37976: Prevent shadowing of TypeError in zip() (GH-15592)Sergey Fedoseev2019-08-301-0/+12
|
* bpo-37417: Fix error handling in bytearray.extend. (GH-14407)Brandt Bucher2019-06-261-0/+5
|