summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_builtin.py
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* bpo-36027: Extend three-argument pow to negative second argument (GH-13266)Mark Dickinson2019-06-021-1/+2
|
* bpo-34616: Fix code style and unbreak buildbots (GH-13473)Yury Selivanov2019-05-211-18/+20
| | | See also PR GH-13148.
* bpo-34616: Add PyCF_ALLOW_TOP_LEVEL_AWAIT to allow top-level await (GH-13148)Matthias Bussonnier2019-05-211-1/+72
| | | Co-Authored-By: Yury Selivanov <yury@magic.io>
* bpo-35742: Fix test_envar_unimportable in test_builtin. (GH-11561)Serhiy Storchaka2019-01-151-0/+1
| | | | | Handle the case of an empty module name in PYTHONBREAKPOINT. Fixes a regression introduced in bpo-34756.
* bpo-35133: Fix mistakes when concatenate string literals on different lines. ↵Serhiy Storchaka2018-11-051-1/+1
| | | | | | | | | | (GH-10284) Two kind of mistakes: 1. Missed space. After concatenating there is no space between words. 2. Missed comma. Causes unintentional concatenating in a list of strings.
* bpo-34320: Fix dict(o) didn't copy order of dict subclass (GH-8624)INADA Naoki2018-09-261-0/+9
| | | | | | | When dict subclass overrides order (`__iter__()`, `keys()`, and `items()`), `dict(o)` should use it instead of dict ordering. https://bugs.python.org/issue34320
* bpo-34637: Make the *start* argument for *sum()* visible as a keyword ↵Raymond Hettinger2018-09-121-0/+3
| | | | argument. (GH-9208)
* bpo-34149: Behavior of the min/max with key=None (GH-8328)Alexander Marshalov2018-07-241-0/+4
| | | Improve consistency with the signature for sorted(), heapq.nsmallest(), heapq.nlargest(), and itertools.groupby().
* bpo-27169: The __debug__ constant is now optimized out at compile time. (#4880)Serhiy Storchaka2017-12-151-8/+8
| | | This fixes also bpo-22091.
* bpo-29240: PEP 540: Add a new UTF-8 Mode (#855)Victor Stinner2017-12-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | * Add -X utf8 command line option, PYTHONUTF8 environment variable and a new sys.flags.utf8_mode flag. * If the LC_CTYPE locale is "C" at startup: enable automatically the UTF-8 mode. * Add _winapi.GetACP(). encodings._alias_mbcs() now calls _winapi.GetACP() to get the ANSI code page * locale.getpreferredencoding() now returns 'UTF-8' in the UTF-8 mode. As a side effect, open() now uses the UTF-8 encoding by default in this mode. * Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8 encoding in the UTF-8 Mode. * Update subprocess._args_from_interpreter_flags() to handle -X utf8 * Skip some tests relying on the current locale if the UTF-8 mode is enabled. * Add test_utf8mode.py. * _Py_DecodeUTF8_surrogateescape() gets a new optional parameter to return also the length (number of wide characters). * pymain_get_global_config() and pymain_set_global_config() now always copy flag values, rather than only copying if the new value is greater than the old value.
* PEP 553 built-in breakpoint() function (bpo-31353) (#3355)Barry Warsaw2017-10-051-1/+109
| | | Implement PEP 553, built-in breakpoint() with support from sys.breakpointhook(), along with documentation and tests. Closes bpo-31353
* bpo-31657: Add test coverage for the __debug__ case (GH-3450)diana2017-10-031-8/+11
| | | | | | Update the compile tests for optimization levels to also check that __debug__ blocks are included or excluded based on the optimization level. Patch by Diana Clarke.
* bpo-31160: test_builtin: don't check waitpid() status (#3050)Victor Stinner2017-08-091-2/+2
|
* bpo-31160: Fix test_builtin for zombie process (#3043)Victor Stinner2017-08-091-0/+4
| | | | | PtyTests.run_child() now calls os.waitpid() to read the exit status of the child process to avoid creating zombie process and leaking processes in the background.
* [security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302)Serhiy Storchaka2017-06-281-0/+6
| | | | | | | Based on patch by Victor Stinner. Add private C API function _PyUnicode_AsUnicode() which is similar to PyUnicode_AsUnicode(), but checks for null characters.
* bpo-29839: Raise ValueError rather than OverflowError in len() for negative ↵Serhiy Storchaka2017-04-161-0/+8
| | | | values. (#701)
* bpo-29919: Remove unused imports found by pyflakes (#137)Victor Stinner2017-03-271-1/+1
| | | Make also minor PEP8 coding style fixes on modified imports.
* Issue #29327: Fixed a crash when pass the iterable keyword argument to sorted().Serhiy Storchaka2017-01-201-0/+10
|
* Issue #28385: An error message when non-empty format spec is passed toSerhiy Storchaka2016-10-301-13/+11
|\ | | | | | | object.__format__ now contains the name of actual type.
| * Issue #28385: An error message when non-empty format spec is passed toSerhiy Storchaka2016-10-301-13/+11
| | | | | | | | object.__format__ now contains the name of actual type.
* | Issue #24254: Drop cls.__definition_order__.Eric Snow2016-09-081-191/+1
| |
* | #27364: fix "incorrect" uses of escape character in the stdlib.R David Murray2016-09-081-2/+2
| | | | | | | | | | | | | | And most of the tools. Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and Martin Panter.
* | Issue #24254: Preserve class attribute definition order.Eric Snow2016-09-051-1/+191
| |
* | MergeRaymond Hettinger2016-09-031-0/+11
|\ \ | |/
| * Issue 27936: Fix inconsistent round() behavior between float and intRaymond Hettinger2016-09-031-0/+11
| |
* | Issue #27366: Implement PEP 487Nick Coghlan2016-07-301-15/+5
|/ | | | | | - __init_subclass__ called when new subclasses defined - __set_name__ called when descriptors are part of a class definition
* Issue #25983: Added tests for multi-argument type().Serhiy Storchaka2016-02-081-0/+155
|
* Issue #24402: Merge potential test fix from 3.4 into 3.5Martin Panter2015-10-101-45/+48
|\