summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* bpo-30966: Add multiprocessing.SimpleQueue.close() (GH-19735)Victor Stinner2020-04-271-0/+14
| | | | | | Add a new close() method to multiprocessing.SimpleQueue to explicitly close the queue. Automerge-Triggered-By: @pitrou
* bpo-40375: Implement imaplib.IMAP4.unselect (GH-19712)Dong-hee Na2020-04-271-0/+25
|
* bpo-40398: Fix typing.get_args() for special generic aliases. (GH-19720)Serhiy Storchaka2020-04-271-2/+7
|
* bpo-40396: Support GenericAlias in the typing functions. (GH-19718)Serhiy Storchaka2020-04-261-1/+41
|
* bpo-40275: Avoid importing logging in test.support (GH-19601)Serhiy Storchaka2020-04-253-36/+32
| | | | | Import logging lazily in assertLogs() in unittest. Move TestHandler from test.support to logging_helper.
* bpo-40275: Avoid importing socket in test.support (GH-19603)Serhiy Storchaka2020-04-2536-370/+401
| | | | | | * Move socket related functions from test.support to socket_helper. * Import socket, nntplib and urllib.error lazily in transient_internet(). * Remove importing multiprocess.
* bpo-40275: Avoid importing asyncio in test.support (GH-19600)Serhiy Storchaka2020-04-251-1/+1
| | | | | * Import asyncio lazily in unittest (only when IsolatedAsyncioTestCase is used). * Import asyncio.events lazily in test.support.
* bpo-40360: Deprecate lib2to3 module in light of PEP 617 (GH-19663)Carl Meyer2020-04-241-0/+1
| | | | | Deprecate lib2to3 module in light of PEP 617. We anticipate removal in the 3.12 timeframe.
* bpo-40334: Rewrite test_c_parser to avoid memory leaks (GH-19694)Lysandros Nikolaou2020-04-241-80/+144
| | | | | | | | | | Previously every test was building an extension module and loading it into sys.modules. The tearDown function was thus not able to clean up correctly, resulting in memory leaks. With this commit, every test function now builds the extension module and runs the actual test code in a new process (using assert_python_ok), so that sys.modules stays intact and no memory gets leaked.
* bpo-39983: Add test.support.print_warning() (GH-19683)Victor Stinner2020-04-235-31/+50
| | | | | | | Log "Warning -- ..." test warnings into sys.__stderr__ rather than sys.stderr, to ensure to display them even if sys.stderr is captured. test.libregrtest.utils.print_warning() now calls test.support.print_warning().
* bpo-40370: Use the same compile and link args as the interpreter used in ↵Pablo Galindo2020-04-231-0/+4
| | | | test_peg_generator (GH-19674)
* bpo-40334: Suppress all output in test_peg_generator (GH-19675)Lysandros Nikolaou2020-04-232-5/+1
|
* bpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670)Victor Stinner2020-04-2317-31/+45
| | | | | | | | | | | * Rename PyConfig.use_peg to _use_peg_parser * Document PyConfig._use_peg_parser and mark it a deprecated * Mark -X oldparser option and PYTHONOLDPARSER env var as deprecated in the documentation. * Add use_old_parser() and skip_if_new_parser() to test.support * Remove sys.flags.use_peg: use_old_parser() uses _testinternalcapi.get_configs() instead. * Enhance test_embed tests * subprocess._args_from_interpreter_flags() copies -X oldparser
* bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)Pablo Galindo2020-04-2225-83/+2247
| | | | Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* bpo-39939: Add str.removeprefix and str.removesuffix (GH-18939)sweeneyde2020-04-222-1/+37
| | | | | Added str.removeprefix and str.removesuffix methods and corresponding bytes, bytearray, and collections.UserString methods to remove affixes from a string if present. See PEP 616 for a full description.
* bpo-39562: Prevent collision of future and compiler flags (GH-19230)Batuhan Taşkaya2020-04-221-0/+17
| | | | | | The constant values of future flags in the __future__ module is updated in order to prevent collision with compiler flags. Previously PyCF_ALLOW_TOP_LEVEL_AWAIT was clashing with CO_FUTURE_DIVISION.
* bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19637)Victor Stinner2020-04-221-21/+51
| | | | | | | | Fix the Windows implementation of os.waitpid() for exit code larger than "INT_MAX >> 8". The exit status is now interpreted as an unsigned number. os.waitstatus_to_exitcode() now accepts wait status larger than INT_MAX.
* bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480)Joshua Root2020-04-221-0/+51
| | | | | | | It is possible to use either '-isysroot /some/path' (with a space) or '-isysroot/some/path' (no space in between). Support both forms in places where special handling of -isysroot is done, rather than just the first form. Co-authored-by: Ned Deily <nad@python.org>
* bpo-40335: Correctly handle multi-line strings in tokenize error scenarios ↵Pablo Galindo2020-04-211-1/+11
| | | | | (GH-19619) Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
* bpo-39942:Fix failure in `TypeVar` when missing `__name__` (GH-19616)HongWeipeng2020-04-201-0/+7
| | | https://bugs.python.org/issue39942
* bpo-40330: Fix utf-8 size check in ShareableList (GH-19606)Antoine Pitrou2020-04-201-2/+14
| | | | | The item size must be checked after encoding to bytes, not before. Automerge-Triggered-By: @pitrou
* bpo-40260: Revert breaking changes made in modulefinder (GH-19595)Barry2020-04-201-3/+14
|
* bpo-40148: Add PurePath.with_stem() (GH-19295)Tim Hoffmann2020-04-191-0/+31
| | | | Add PurePath.with_stem()
* bpo-39207: Spawn workers on demand in ProcessPoolExecutor (GH-19453)Kyle Stanley2020-04-191-4/+40
| | | | | Roughly based on https://github.com/python/cpython/commit/904e34d4e6b6007986dcc585d5c553ee8ae06f95, but with a few substantial differences. /cc @pitrou @brianquinlan
* bpo-40325: Deprecate set object support in random.sample() (GH-19591)Raymond Hettinger2020-04-191-1/+5
|
* bpo-35113: Fix inspect.getsource to return correct source for inner classes ↵Karthikeyan Singaravelan2020-04-183-4/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#10307) * Use ast module to find class definition * Add NEWS entry * Fix class with multiple children and move decorator code to the method * Fix PR comments 1. Use node.decorator_list to select decorators 2. Remove unwanted variables in ClassVisitor 3. Simplify stack management as per review * Add test for nested functions and async calls * Fix pydoc test since comments are returned now correctly * Set event loop policy as None to fix environment related change * Refactor visit_AsyncFunctionDef and tests * Refactor to use local variables and fix tests * Add patch attribution * Use self.addCleanup for asyncio * Rename ClassVisitor to ClassFinder and fix asyncio cleanup * Return first class inside conditional in case of multiple definitions. Remove decorator for class source. * Add docstring to make the test correct * Modify NEWS entry regarding decorators * Return decorators too for bpo-15856 * Move ast and the class source code to top. Use proper Exception.
* Add spaces around the ":=" operator in ast_unparse.c (GH-19568)Hakan Çelik2020-04-181-2/+2
|
* bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364)Serhiy Storchaka2020-04-181-0/+105
| | | | Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
* bpo-35967: Skip test with `uname -p` on Android (GH-19577)Chih-Hsuan Yen2020-04-181-2/+5
| | | | | | | | | | | | | | | | | | | The uname binary on Android does not support -p [1]. Here is a sample log: ``` 0:06:03 load avg: 0.56 [254/421/8] test_platform failed -- running: test_asyncio (5 min 53 sec) uname: Unknown option p (see "uname --help") test test_platform failed -- Traceback (most recent call last): File "/data/local/tmp/lib/python3.9/test/test_platform.py", line 170, in test_uname_processor proc_res = subprocess.check_output(['uname', '-p'], text=True).strip() File "/data/local/tmp/lib/python3.9/subprocess.py", line 420, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/data/local/tmp/lib/python3.9/subprocess.py", line 524, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['uname', '-p']' returned non-zero exit status 1. ``` [1] https://android.googlesource.com/platform/external/toybox/+/refs/heads/master/toys/posix/uname.c Automerge-Triggered-By: @jaraco
* bpo-40257: Improve help for the typing module (GH-19546)Serhiy Storchaka2020-04-181-1/+2
| | | | | | * Show docstring for special forms. * Show docstring for special generic aliases. * Show documentation for __origin__ for generic aliases.
* bpo-40286: Use random.randbytes() in tests (GH-19575)Victor Stinner2020-04-175-28/+9
|
* bpo-40286: Makes simpler the relation between randbytes() and getrandbits() ↵Serhiy Storchaka2020-04-171-4/+20
| | | | (GH-19574)
* bpo-40282: Allow random.getrandbits(0) (GH-19539)Antoine Pitrou2020-04-171-40/+29
|
* bpo-40286: Add randbytes() method to random.Random (GH-19527)Victor Stinner2020-04-171-0/+51
| | | | | | | | | | | | Add random.randbytes() function and random.Random.randbytes() method to generate random bytes. Modify secrets.token_bytes() to use SystemRandom.randbytes() rather than calling directly os.urandom(). Rename also genrand_int32() to genrand_uint32(), since it returns an unsigned 32-bit integer, not a signed integer. The _random module is now built with Py_BUILD_CORE_MODULE defined.
* bpo-40300: Allow empty logging.Formatter.default_msec_format. (GH-19551)Mariusz Felisiak2020-04-171-0/+13
|
* bpo-40302: Add pycore_byteswap.h header file (GH-19552)Victor Stinner2020-04-171-0/+8
| | | | | | | | | | | | | | Add a new internal pycore_byteswap.h header file with the following functions: * _Py_bswap16() * _Py_bswap32() * _Py_bswap64() Use these functions in _ctypes, sha256 and sha512 modules, and also use in the UTF-32 encoder. sha256, sha512 and _ctypes modules are now built with the internal C API.
* bpo-40287: Fix SpooledTemporaryFile.seek() return value (GH-19540)Inada Naoki2020-04-171-2/+4
| | | It has not returned the file position after the seek.
* bpo-39793: use the same domain on make_msgid tests (#18698)Batuhan Taşkaya2020-04-161-4/+6
| | | | | * bpo-39793: use same domain on make_msgid tests * apply suggestions
* bpo-40290: Add zscore() to statistics.NormalDist. (GH-19547)Raymond Hettinger2020-04-161-0/+15
|
* bpo-35967 resolve platform.processor late (GH-12239)Jason R. Coombs2020-04-161-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Replace flag-flip indirection with direct inspection * Use any for simpler code * Avoid flag flip and set results directly. * Resolve processor in a single function. * Extract processor handling into a namespace (class) * Remove _syscmd_uname, unused * Restore platform.processor behavior to match prior expectation (reliant on uname -p in a subprocess). * Extract '_unknown_as_blank' function. * Override uname_result to resolve the processor late. * Add a test intended to capture the expected values from 'uname -p' * Instead of trying to keep track of all of the possible outputs on different systems (probably a fool's errand), simply assert that except for the known platform variance, uname().processor matches the output of 'uname -p' * Use a skipIf directive * Use contextlib.suppress to suppress the error. Inline strip call. * 📜🤖 Added by blurb_it. * Remove use of contextlib.suppress (it would fail with NameError if it had any effect). Rely on _unknown_as_blank to replace unknown with blank. Co-authored-by: blurb-it[bot] <blurb-it[bot]@users.noreply.github.com>
* bpo-40209: Use tokenize.open in test_unparse (GH-19399)Hakan Çelik2020-04-161-5/+2
|
* bpo-35967: Make test_platform.test_uname_processor more lenient to satisfy ↵Jason R. Coombs2020-04-151-4/+6
| | | | | | | | | | | | | build bots. (GH-19544) * bpo-35967: Make test more lenient to satisfy build bots. * Update Lib/test/test_platform.py Co-Authored-By: Kyle Stanley <aeros167@gmail.com> * Expect '' for 'unknown' Co-authored-by: Kyle Stanley <aeros167@gmail.com>
* bpo-40257: Output object's own docstring in pydoc (GH-19479)Serhiy Storchaka2020-04-152-4/+14
|
* bpo-29255: Wait in KqueueSelector.select when no fds are registered (GH-19508)Russell Davis2020-04-151-0/+13
| | | | Also partially fixes bpo-25680 (there's still a discrepancy in behavior on Windows that needs to be fixed).
* bpo-35967: Baseline values for uname -p (GH-12824)Jason R. Coombs2020-04-151-0/+14
| | | | | | | | | * Add a test intended to capture the expected values from 'uname -p' * Instead of trying to keep track of all of the possible outputs on different systems (probably a fool's errand), simply assert that except for the known platform variance, uname().processor matches the output of 'uname -p' * Use a skipIf directive * Use contextlib.suppress to suppress the error. Inline strip call.
* bpo-40267: Fix message when last input character produces a SyntaxError ↵Lysandros Nikolaou2020-04-151-1/+1
| | | | | | | | (GH-19521) When there is a SyntaxError after reading the last input character from the tokenizer and if no newline follows it, the error message used to be `unexpected EOF while parsing`, which is wrong.
* Clean up compatibility code in importlib fixtures (#19156)Jason R. Coombs2020-04-151-16/+2
|
* bpo-40277: Add a repr() to namedtuple's _tuplegetter to aid with ↵Ammar Askar2020-04-151-0/+12
| | | | introspection (GH-19537)
* bpo-39481: PEP 585 for dataclasses, mailbox, contextvars (GH-19425)Ethan Smith2020-04-142-5/+7
|
* bpo-40260: Update modulefinder to use io.open_code() and respect coding ↵Barry2020-04-141-5/+60
| | | | comments (GH-19488)