summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* bpo-44963: Implement send() and throw() methods for anext_awaitable objects ↵Miss Islington (bot)2021-09-071-0/+172
| | | | | | | | (GH-27955) Co-authored-by: Yury Selivanov <yury@edgedb.com> (cherry picked from commit 533e725821b15e2df2cd4479a34597c1d8faf616) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-45052: Unskips a failing `test_shared_memory_basics` test (GH-28182)Miss Islington (bot)2021-09-061-2/+0
| | | | | (cherry picked from commit 19871fce3b74fc3f37e334a999e00d0ef65a8f1e) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* bpo-44571: Add itertool recipe for a variant of takewhile() (GH-28167)Miss Islington (bot)2021-09-051-0/+49
| | | | | (cherry picked from commit 91be41ad933e24bff26353a19f56447e17fb6367) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
* bpo-45042: Now test classes decorated with `requires_hashdigest` are not ↵Miss Islington (bot)2021-09-043-6/+21
| | | | | | | | skipped (GH-28060) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> (cherry picked from commit dd7b816ac87e468e2fa65ce83c2a03fe1da8503e) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* bpo-45030: Fix integer overflow in __reduce__ of the range iterator (GH-28000)Miss Islington (bot)2021-09-041-2/+8
| | | | | | | It happened with fast range iterator when the calculated stop = start + step * len was out of the C long range. (cherry picked from commit 936f6a16b9ef85bd56b18a247b962801e954c30e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.10] bpo-45097: Add more tests for shutdown_asyncgens() (GH-28154) (GH-28159)Miss Islington (bot)2021-09-041-0/+80
| | | | | | | * bpo-45097: Add more tests for shutdown_asyncgens() (GH-28154) (cherry picked from commit c2970fdec52788b6d9ff419ab7e31f255d87433d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.10] bpo-45060: Get rid of few uses of the equality operators with None ↵Serhiy Storchaka2021-09-043-3/+3
| | | | | | | (GH-28087). (GH-28092) (cherry picked from commit 3c65457156d87e55010507d616b4eecb7a02883d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-45081: Fix __init__ method generation when inheriting from Protocol ↵Miss Islington (bot)2021-09-031-1/+21
| | | | | | | | (GH-28121) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> (cherry picked from commit 0635e201beaf52373f776ff32702795e38f43ae3) Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
* bpo-45057: Simplify RegressionTestResult (GH-28081) (GH-28101)Miss Islington (bot)2021-09-011-31/+2
| | | | | | | Remove code which duplicates the functionality of TextTestResult. (cherry picked from commit 2b76a5322fdf71d62b531fd765085f96f981c244) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-43124: Fix smtplib multiple CRLF injection (GH-25987)Miss Islington (bot)2021-08-291-0/+55
| | | | | | Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 0897253f426068ea6a6fbe0ada01689af9ef1019) Co-authored-by: Miguel Brito <5544985+miguendes@users.noreply.github.com>
* bpo-25130: Make unit-test about restricting the maximum number of nested ↵Miss Islington (bot)2021-08-281-32/+35
| | | | | | | | | | | | blocks cpython-only (GH-28002) (GH-28016) PyPy and potentially other implementations have different or no contraints on the number of blocks that can be statically nested. move the test that checks for this behaviour into a unit test and mark it as CPython-only. (cherry picked from commit eb263f9a356f5c5f21b8d5ce20bac92f31c40cad) Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
* bpo-44524: Fix cryptic TypeError message when trying to subclass special ↵Miss Islington (bot)2021-08-281-0/+16
| | | | | | | | forms in `typing` (GH-27710) This was a Python 3.9 regression. (cherry picked from commit a3a4d20d6798aa2975428d51f3a4f890248810cb) Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
* bpo-45018: Fix rangeiter_reduce in rangeobject.c (GH-27938)Miss Islington (bot)2021-08-281-16/+31
| | | | | | Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 94a3d2a6329ab7941e93ad2f5bcbb8af2b8b80d2) Co-authored-by: chilaxan <chilaxan@gmail.com>
* bpo-45001: Make email date parsing more robust against malformed input ↵Miss Islington (bot)2021-08-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-27946) Various date parsing utilities in the email module, such as email.utils.parsedate(), are supposed to gracefully handle invalid input, typically by raising an appropriate exception or by returning None. The internal email._parseaddr._parsedate_tz() helper used by some of these date parsing routines tries to be robust against malformed input, but unfortunately it can still crash ungracefully when a non-empty but whitespace-only input is passed. This manifests as an unexpected IndexError. In practice, this can happen when parsing an email with only a newline inside a ‘Date:’ header, which unfortunately happens occasionally in the real world. Here's a minimal example: $ python Python 3.9.6 (default, Jun 30 2021, 10:22:16) [GCC 11.1.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import email.utils >>> email.utils.parsedate('foo') >>> email.utils.parsedate(' ') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.9/email/_parseaddr.py", line 176, in parsedate t = parsedate_tz(data) File "/usr/lib/python3.9/email/_parseaddr.py", line 50, in parsedate_tz res = _parsedate_tz(data) File "/usr/lib/python3.9/email/_parseaddr.py", line 72, in _parsedate_tz if data[0].endswith(',') or data[0].lower() in _daynames: IndexError: list index out of range The fix is rather straight-forward: guard against empty lists, after splitting on whitespace, but before accessing the first element. (cherry picked from commit 989f6a3800f06b2bd31cfef7c3269a443ad94fac) Co-authored-by: wouter bolsterlee <wouter@bolsterl.ee>
* bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968)Miss Islington (bot)2021-08-264-7/+10
| | | | | | Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 7dc505b8655b3e48b93a4274dfd26e5856d9c64f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-45000: Raise SyntaxError when try to delete __debug__ (GH-27947) (GH-27957)Dong-hee Na2021-08-261-0/+4
| | | (cherry picked from commit 551da597a0996b0fb3af425f48aa5bc63ea6b963)
* bpo-44524: Don't modify MRO when inheriting from typing.Annotated (GH-27841)Miss Islington (bot)2021-08-251-0/+5
| | | | | (cherry picked from commit 23384a1749359f0ae7aaae052073d44b59e715a1) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* [3.10] bpo-34990: Treat the pyc header's mtime in compileall as an unsigned ↵Miss Islington (bot)2021-08-242-9/+31
| | | | | | | | int (GH-19708) (cherry picked from commit bb21e28fd08f894ceff2405544a2f257d42b1354) Co-authored-by: Ammar Askar <ammar@ammaraskar.com> Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
* bpo-44984: Rewrite test_null_strings in _testcapi (GH-27904)Miss Islington (bot)2021-08-231-0/+12
| | | | | | Test also PyObject_Repr(NULL) and PyObject_Bytes(NULL). (cherry picked from commit 4d689173861257c69adc6dc1dca4171946ddb57f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-44980: fix test_constructor to return None value (GH-27898)Miss Islington (bot)2021-08-231-1/+1
| | | | | (cherry picked from commit 27b761a11a14521617a01257eb3767150bec3a74) Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
* bpo-44968: Fix test_subprocess_wait_no_same_group in test_asyncio (GH-27870)Miss Islington (bot)2021-08-211-1/+2
| | | | | | | The code of the test was never executed because the test function was unintentionally converted to a generator function. (cherry picked from commit 585390fdd8661b4bc08bdfc27551292da9b4b9b8) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-44524: Do not set _name of _SpecialForm without need (GH-27861) (GH-27871)Miss Islington (bot)2021-08-211-1/+0
| | | | | | | | | Because setting non-empty _name affects behavior of other code. In most cases __name__ can be derived from __origin__.__name__. (cherry picked from commit 4ceec495598e78f0776dd46d511dcc612a434dc3) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-44954: Fix wrong result in float.fromhex corner case (GH-27834)Miss Islington (bot)2021-08-201-0/+14
| | | | | (cherry picked from commit 60b93d9e4922eeae25052bc15909d1f4152babde) Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
* bpo-44949: Fix test_readline auto history tests (GH-27813)Miss Islington (bot)2021-08-191-2/+6
| | | | | (cherry picked from commit 6fb62b42f4db56ed5efe0ca4c1059049276c1083) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-44947: Refine the syntax error for trailing commas in import statements ↵Miss Islington (bot)2021-08-181-0/+7
| | | | | | | (GH-27814) (cherry picked from commit b2f68b190035540872072ac1d2349e7745e85596) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-44852: Support filtering over warnings without a set message (GH-27793)Miss Islington (bot)2021-08-181-4/+5
| | | | | | | | | | | | | Additional improvements: - messages which were compiled regular expressions aren't unpacked back into strings for unmatched warnings; - removed unnecessary "if tokens:" check (there's one before the for loop); - took `endswith` calculation out of the for loop. (cherry picked from commit 8cf07d3db3eed02b43350a5f9dbf68f1c839ea82) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-44698: Restore complex pow behaviour for small integral exponents ↵Miss Islington (bot)2021-08-171-0/+28
| | | | | | | (GH-27772) (GH-27796) (cherry picked from commit 4b9a2dcf19e5d13c3bc2afea2de1f65cd994c699) Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
* [3.10] bpo-44852: Support ignoring specific DeprecationWarnings wholesale in ↵Łukasz Langa2021-08-173-0/+70
| | | | | | | regrtest (GH-27634) (GH-27784) (cherry picked from commit a0a6d39295a30434b088f4b66439bf5ea21a3e4e) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-38956: don't print BooleanOptionalAction's default twice (GH-27672)Miss Islington (bot)2021-08-171-7/+14
| | | | | | Co-authored-by: Micky Yun Chan <michan@redhat.com> (cherry picked from commit 1512bc21d60f098a9e9f37b44a2f6a9b49a3fd4f) Co-authored-by: Maximilian Hils <git@maximilianhils.com>
* bpo-44895: skip test_no_hang_on_context_chain_cycle2 until the refleak is ↵Miss Islington (bot)2021-08-161-3/+1
| | | | | | | fixed (GH-27761) (cherry picked from commit 62bc716fde20fcb7b47416c7959be9e66df93212) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* Added test case based on recommended test cases from RFC 4648 (GH-27747)Miss Islington (bot)2021-08-131-0/+39
| | | | | (cherry picked from commit 230403a6a19042b174374c3825904d2e857f38b0) Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
* bpo-44891: Tests `id` preserving on `* 1` for `str` and `bytes` (GH-27745)Miss Islington (bot)2021-08-132-0/+44
| | | | | | Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit a2ce538e16d5e3a6168704366bdd7a8c5af29881) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* bpo-44895: Temporarily add an extra gc.collect() call (GH-27746)Miss Islington (bot)2021-08-131-0/+3
| | | | | | This is part of an investigation of a non-deterministic reference leak. While we're looking for the root cause, this is included temporarily so that CI doesn't fail on this particular issue. This enables it to find other regressions in the meantime, which would otherwise be shadowed by our known issue. (cherry picked from commit 7bf28cbb4bf37fa6bdfc2d3f8a3939066b3f8f22) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* [3.10] bpo-33930: Fix typo in the test name. (GH-27736)Benjamin Peterson2021-08-131-1/+1
| | | | | | [bpo-33930](): Fix typo in the test name. (GH-27733) (cherry picked from commit f08e6d1bb3c5655f184af88c6793e90908bb6338) Automerge-Triggered-By: GH:benjaminp
* [3.10] bpo-44885: Correct the ast locations of f-strings with format specs ↵Pablo Galindo Salgado2021-08-121-11/+29
| | | | | | | and repeated expressions (GH-27729) (GH-27743) (cherry picked from commit 8e832fb2a2cb54d7262148b6ec15563dffb48d63) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-26228: Fix pty EOF handling (GH-12049) (GH-27732)Miss Islington (bot)2021-08-121-17/+52
| | | | | | | | | | | | | On non-Linux POSIX platforms, like FreeBSD or macOS, the FD used to read a forked PTY may signal its exit not by raising an error but by sending empty data to the read syscall. This case wasn't handled, leading to hanging `pty.spawn` calls. Co-authored-by: Reilly Tucker Siemens <reilly@tuckersiemens.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 81ab8db235580317edcb0e559cd4c983f70883f5) Co-authored-by: Zephyr Shannon <geoffpshannon@gmail.com>
* bpo-33930: Fix segfault with deep recursion when cleaning method objects ↵Miss Islington (bot)2021-08-111-0/+15
| | | | | | | (GH-27678) (GH-27719) (cherry picked from commit bfc2d5a5c4550ab3a2fadeb9459b4bd948ff61a2) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-14853: add back the stdin test, skip if stdin is redirected (GH-27694)Miss Islington (bot)2021-08-101-0/+16
| | | | | (cherry picked from commit 8ed183391241f0c73e7ba7f42b1d49fc02985f7b) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* bpo-25782: avoid hang in PyErr_SetObject when current exception has a cycle ↵Miss Islington (bot)2021-08-101-0/+142
| | | | | | | | in its context chain (GH-27626) Co-authored-by: Dennis Sweeney 36520290+sweeneyde@users.noreply.github.com (cherry picked from commit d5c217475c4957a8084ac3f92ae012ece5edc7cb) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* bpo-41402: Fix email ContentManager calling .encode() on bytes (GH-21631)Miss Islington (bot)2021-08-091-0/+12
| | | | | (cherry picked from commit b33186bc43bb5aaf652dd9d093a08fdde796d499) Co-authored-by: Johannes Reiff <mail@jreiff.de>
* bpo-32695: Docs and tests for compresslevel and preset kwargs in tarfile ↵Miss Islington (bot)2021-08-091-3/+18
| | | | | | | | (GH-21470) Co-Authored-By: Bo Bayles <bbayles@gmail.com> (cherry picked from commit eb2d4a66ff07aa6e51cfaaa31afed31addf76936) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-44840: Compiler: Move duplication of exit blocks with no line numbers to ↵Mark Shannon2021-08-092-51/+74
| | | | | after CFG optimization. (GH-27656) (#27673) (cherry picked from commit b854557b49083d8625a433eb36aacb0c87d67c52)
* bpo-44605: Teach @total_ordering() to work with metaclasses (GH-27633) ↵Miss Islington (bot)2021-08-061-0/+28
| | | | (GH-27640)
* bpo-40928: notify users running test_decimal on macOS of malloc warnings ↵Miss Islington (bot)2021-08-062-1/+24
| | | | | | | | | | | (GH-26783) * When trying to allocate very large regions on macOS, malloc does not fail silently. It sends a noisy error out to STDERR * This provides a helper function to warn the user, and provides the warning for test_decimal, which consistently generates these warnings on macOS. Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 15d3c14df32a35ac69898a7852115722e30d7857) Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
* bpo-44524: Fix an issue wherein `_GenericAlias._name` was not properly set ↵Miss Islington (bot)2021-08-061-54/+173
| | | | | | | | | for specialforms (GH-27614) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 8bdf12e99a3dc7ada5f85bba79c2a9eb9931f5b0) Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
* bpo-44584: Deprecate PYTHONTHREADDEBUG env var (GH-27065)Miss Islington (bot)2021-08-061-0/+13
| | | | | | | | The threading debug (PYTHONTHREADDEBUG environment variable) is deprecated in Python 3.10 and will be removed in Python 3.12. This feature requires a debug build of Python. (cherry picked from commit 4d77691172aae81bdcbb0ea75839d0e896c43781) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.10] bpo-44838: Refine the custom syntax errors for invalid 'if' ↵Pablo Galindo Salgado2021-08-051-0/+8
| | | | | | | | | | | expressions (GH-27615). (GH-27616) … (cherry picked from commit f5cbea6b1b5fc39cca377c6cc93f222916015fc4) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Automerge-Triggered-By: GH:lysnikolaou
* bpo-44801: Check arguments in substitution of ParamSpec in Callable (GH-27585)Miss Islington (bot)2021-08-041-3/+42
| | | | | (cherry picked from commit 3875a6954741065b136650db67ac533bc70a3eac) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-44808: fixes test for interactive inspect getsource of a class (GH-27571)Miss Islington (bot)2021-08-031-12/+8
| | | | | | Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 58325971de0faf330c9c38269dae8315a0746e59) Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
* bpo-39091: Fix segfault when Exception constructor returns non-exception for ↵Miss Islington (bot)2021-08-031-0/+26
| | | | | | | | gen.throw. (GH-17658) (GH-27572) Co-authored-by: Benjamin Peterson <benjamin@python.org> (cherry picked from commit 83ca46b7784b7357d82ec47b33295e09ed7380cb) Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>