Commit graph

29093 commits

Author SHA1 Message Date
Alex Waygood
a023de65fc
[3.11] Fix typos in docs and comments (#109619) (#109622)
Co-authored-by: Heinz-Alexander Fuetterer <35225576+afuetterer@users.noreply.github.com>
2023-09-20 17:50:48 +00:00
Victor Stinner
8c7fadb9bf
[3.11] gh-103053: Skip test_freeze_simple_script() on PGO build (#109591) (#109616)
gh-103053: Skip test_freeze_simple_script() on PGO build (#109591)

Skip test_freeze_simple_script() of test_tools.test_freeze if Python
is built with "./configure --enable-optimizations", which means with
Profile Guided Optimization (PGO): it just makes the test too slow.
The freeze tool is tested by many other CIs with other (faster)
compiler flags.

test.pythoninfo now gets also get_build_info() of
test.libregrtests.utils.

(cherry picked from commit 81cd1bd713)
2023-09-20 15:45:23 +00:00
Shantanu
2184b76496
[3.11] gh-108843: fix ast.unparse for f-string with many quotes (#108980)
* [3.11] gh-108843: fix ast.unparse for f-string with many quotes

* 📜🤖 Added by blurb_it.

* simplify

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2023-09-18 15:11:56 +01:00
Hugo van Kemenade
a95d159bba
[3.11] gh-60283: Check for redefined test names in CI (#109161) (#109366)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
(cherry picked from commit 3cb9a8edca)
2023-09-15 05:45:23 +00:00
Victor Stinner
7a20797056
[3.11] gh-108822: Fix regrtest clear_caches() (#109432)
gh-108822: Fix regrtest clear_caches()

Python 3.11 doesn't have fractions._hash_algorithm cache.
2023-09-15 00:07:28 +00:00
Miss Islington (bot)
f7bfac4b3d
[3.11] gh-109396: Fix test_socket.test_hmac_sha1() in FIPS mode (GH-109423) (#109427)
gh-109396: Fix test_socket.test_hmac_sha1() in FIPS mode (GH-109423)

Use a longer key: FIPS mode requires at least of at least 112 bits.
The previous key was only 32 bits.
(cherry picked from commit e091b9f20f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-15 00:52:40 +02:00
Miss Islington (bot)
f1f85a42ea
[3.11] gh-109351: Fix crash when compiling AST with invalid NamedExpr (GH-109352) (#109380)
gh-109351: Fix crash when compiling AST with invalid NamedExpr (GH-109352)
(cherry picked from commit 79101edb03)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-09-13 16:32:08 +00:00
Miss Islington (bot)
66c0d0ac8c
[3.11] gh-104736: Fix test_gdb tests on ppc64le with clang (GH-109360) (#109362)
gh-104736: Fix test_gdb tests on ppc64le with clang (GH-109360)

Fix test_gdb on Python built with LLVM clang 16 on Linux ppc64le (ex:
Fedora 38). Search patterns in gdb "bt" command output to detect
when gdb fails to retrieve the traceback. For example, skip a test if
"Backtrace stopped: frame did not save the PC" is found.
(cherry picked from commit 44d9a71ea2)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-13 04:48:44 +00:00
Irit Katriel
1e8696133c
[3.11] gh-109179: Fix traceback display for SyntaxErrors with notes (#109197) (#109283)
gh-109179: Fix traceback display for SyntaxErrors with notes (#109197)

(cherry picked from commit ecd21a629a)
2023-09-12 09:57:28 +00:00
Miss Islington (bot)
5d47fb186e
[3.11] gh-109295: Fix test_os.test_access_denied() for TEMP=cwd (GH-109299) (#109303)
gh-109295: Fix test_os.test_access_denied() for TEMP=cwd (GH-109299)

Fix test_os.test_access_denied() when the TEMP environment variable
is equal to the current working directory. Run the test using a
different filename, since self.fname already exists in this case.
(cherry picked from commit 7dedfd36dc)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-12 02:00:36 +00:00
Miss Islington (bot)
abf3a68fe3
[3.11] gh-109295: Clean up multiprocessing in test_asyncio and test_compileall (GH-109298) (#109302)
gh-109295: Clean up multiprocessing in test_asyncio and test_compileall (GH-109298)

test_asyncio and test_compileall now clean up multiprocessing by
calling multiprocessing _cleanup_tests(): explicitly clean up
resources and stop background processes like the resource tracker.
(cherry picked from commit 09ea4b8706)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-12 01:53:59 +00:00
Miss Islington (bot)
9297a72dbd
[3.11] gh-90805: Make sure test_functools works with and without _functoolsmodule (GH-108644) (GH-109274)
(cherry picked from commit baa6dc8e38)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-09-11 16:35:41 +00:00
Miss Islington (bot)
74988a47e7
[3.11] Test DocTestFinder directly instead of calling support.run_doctest() (GH-108917) (GH-109260)
(cherry picked from commit 0abc935086)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-11 11:30:24 +00:00
Miss Islington (bot)
a7e80fb628
[3.11] gh-109230: test_pyexpat no longer depends on the current directory (GH-109233) (#109242)
gh-109230: test_pyexpat no longer depends on the current directory (GH-109233)

Fix test_pyexpat.test_exception(): it can now be run from a directory
different than Python source code directory. Before, the test failed
in this case.

Skip the test if Modules/pyexpat.c source is not available. Skip also
the test on Python implementations other than CPython.
(cherry picked from commit e55aab9578)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-10 22:46:47 +00:00
Miss Islington (bot)
cef4951116
[3.11] gh-109237: Fix test_site for non-ASCII working directory (GH-109238) (#109240)
gh-109237: Fix test_site for non-ASCII working directory (GH-109238)

Fix test_site.test_underpth_basic() when the working directory
contains at least one non-ASCII character: encode the "._pth" file to
UTF-8 and enable the UTF-8 Mode to use UTF-8 for the child process
stdout.
(cherry picked from commit cbb3a6f8ad)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-10 22:39:49 +00:00
Miss Islington (bot)
b070d73ff2
[3.11] gh-50644: Forbid pickling of codecs streams (GH-109180) (GH-109232)
Attempts to pickle or create a shallow or deep copy of codecs streams
now raise a TypeError.

Previously, copying failed with a RecursionError, while pickling
produced wrong results that eventually caused unpickling to fail with
a RecursionError.
(cherry picked from commit d6892c2b92)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-10 17:41:19 +00:00
Miss Islington (bot)
c20658249d
[3.11] gh-109207: Fix SystemError when printing symtable entry object. (GH-109225) (GH-109228)
(cherry picked from commit 4297499696)

Co-authored-by: 云line <31395137+yunline@users.noreply.github.com>
2023-09-10 16:50:22 +03:00
Miss Islington (bot)
6b2f44ea78
[3.11] GH-109067: fix randomly failing test_async_gen_asyncio_gc_aclose_09 test (GH-109142) (#109150)
GH-109067: fix randomly failing `test_async_gen_asyncio_gc_aclose_09` test (GH-109142)

Use `asyncio.sleep(0)` instead of short sleeps.
(cherry picked from commit ccd48623d4)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2023-09-08 17:02:57 +00:00
Miss Islington (bot)
c1a2ef5efc
[3.11] gh-106922: Fix error location for constructs with spaces and parentheses (GH-108959) (#109148)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-09-08 16:56:10 +00:00
Miss Islington (bot)
9dd28d2da9
[3.11] gh-108962: Skip test_tempfile.test_flags() if not supported (GH-108964) (#108968)
gh-108962: Skip test_tempfile.test_flags() if not supported (GH-108964)

Skip test_tempfile.test_flags() if chflags() fails with "OSError:
[Errno 45] Operation not supported" (ex: on FreeBSD 13).
(cherry picked from commit cd2ef21b07)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-08 07:07:54 +00:00
Ethan Furman
effa2ecdcf
[3.11] gh-108682: [Enum] raise TypeError if super().__new__ called in custom __new__ (GH-108704) (GH-108739)
When overriding the `__new__` method of an enum, the underlying data type should be created directly; i.e. .

    member = object.__new__(cls)
    member = int.__new__(cls, value)
    member = str.__new__(cls, value)

Calling `super().__new__()` finds the lookup version of `Enum.__new__`, and will now raise an exception when detected.

(cherry picked from commit d48760b2f1)
2023-09-07 18:57:48 -07:00
Miss Islington (bot)
e46be0d2fa
[3.11] gh-68403: Fix test_coverage in test_trace (GH-108910) (GH-109105)
Its behavior no longer affected by test running options such as -m.
(cherry picked from commit 7e1a7abb98)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-07 19:10:19 +00:00
Miss Islington (bot)
c2b8d4fe0d
[3.11] gh-75743: Restore test_timeout.testConnectTimeout() (GH-109087) (#109102)
gh-75743: Restore test_timeout.testConnectTimeout() (GH-109087)

This un-skips this test now that pythontest.net implements appropriate firewall
rules for it.
(cherry picked from commit 1829a3c9a3)

Co-authored-by: Ee Durbin <ewdurbin@gmail.com>
2023-09-07 18:55:50 +00:00
Serhiy Storchaka
dae62d456e
[3.11] gh-88943: Improve syntax error for non-ASCII character that follows a numerical literal (GH-109081) (GH-109091)
It now points on the invalid non-ASCII character, not on the valid numerical literal.
(cherry picked from commit b2729e93e9)
2023-09-07 14:54:07 +00:00
Serhiy Storchaka
49cc2e7984
[3.11] gh-103186: Suppress RuntimeWarning about unclosed async iterator in test_sys_settrace (GH-109075) (GH-109086)
(cherry picked from commit d485551c9d)
2023-09-07 14:16:13 +00:00
Miss Islington (bot)
12f40a4340
[3.11] gh-103186: Remove debug print in test_sys_settrace (GH-109077) (GH-109085)
(cherry picked from commit e4bb0026b9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-07 14:13:42 +00:00
Miss Islington (bot)
883ff44f0d
[3.11] test.pythoninfo logs freedesktop_os_release() (GH-109057) (#109063)
test.pythoninfo logs freedesktop_os_release() (GH-109057)
(cherry picked from commit babdced23f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-07 06:13:34 +00:00
Victor Stinner
1ebe014d62
[3.11] gh-109015: Add test.support.socket_helper.tcp_blackhole() (#109016) (#109042)
gh-109015: Add test.support.socket_helper.tcp_blackhole() (#109016)

Skip test_asyncio, test_imaplib and test_socket tests if FreeBSD TCP
blackhole is enabled (net.inet.tcp.blackhole=2).

(cherry picked from commit a52a350977)
2023-09-07 00:34:16 +00:00
Victor Stinner
95eb9849dd
[3.11] gh-108851: Fix tomllib recursion tests (#108853) (#109013)
gh-108851: Fix tomllib recursion tests (#108853)

* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* Change infinite_recursion() default max_depth from 75 to 100.
* Fix test_tomllib recursion tests for WASI buildbots: reduce the
  recursion limit and compute the maximum nested array/dict depending
  on the current available recursion limit.
* test.pythoninfo logs sys.getrecursionlimit().
* Enhance test_sys tests on sys.getrecursionlimit()
  and sys.setrecursionlimit().

Backport notes:

* Set support.infinite_recursion() minimum to 4 frames.
* test_support.test_get_recursion_depth() uses limit-2, apparently
  f-string counts for 2 frames in Python 3.11.
* test_sys.test_setrecursionlimit_to_depth() tests depth+2 instead of
  depth+1.

(cherry picked from commit 8ff1142578)
2023-09-06 16:40:39 +00:00
Miss Islington (bot)
d61b8f9b8b
[3.11] gh-91960: Skip test_gdb if gdb cannot retrive Python frames (GH-108999) (#109011)
gh-91960: Skip test_gdb if gdb cannot retrive Python frames (GH-108999)

Skip test_gdb if gdb is unable to retrieve Python frame objects: if a
frame is "<optimized out>". When Python is built with "clang -Og",
gdb can fail to retrive the 'frame' parameter of
_PyEval_EvalFrameDefault(). In this case, tests like py_bt() are
likely to fail. Without getting access to Python frames,
python-gdb.py is mostly clueless on retrieving the Python traceback.
Moreover, test_gdb is no longer skipped on macOS if Python is built
with Clang.
(cherry picked from commit fbce43a251)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-06 15:32:36 +00:00
Miss Islington (bot)
b8340905fc
[3.11] gh-108983: Add more PEP 526 tests to test_grammar (GH-108984) (#109001)
gh-108983: Add more PEP 526 tests to `test_grammar` (GH-108984)
(cherry picked from commit 1fb20d42c5)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-09-06 14:09:54 +00:00
Serhiy Storchaka
cf19e8ea3a
[3.11] gh-108416: Mark slow but not CPU bound test methods with requires_resource('walltime') (GH-108480) (GH-108924)
(cherry picked from commit 1e0d62793a)
2023-09-05 15:27:55 +00:00
Miss Islington (bot)
4e5fd6dc14
[3.11] gh-89392: Use unittest test runner for doctests in test_getopt (GH-108916) (GH-108920)
(cherry picked from commit f980cc19b9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-05 15:08:14 +00:00
Miss Islington (bot)
e2404f5ed9
[3.11] gh-89392: Use normal unittest runner in test_type_cache (GH-108911) (GH-108914)
(cherry picked from commit eaabaac7c0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-05 14:11:49 +00:00
Serhiy Storchaka
492e1ffdce
[3.11] gh-89392: Remove support of test_main() in libregrtest (GH-108876) (GH-108898)
(cherry picked from commit 04a0830b00)
2023-09-05 06:54:12 +00:00
Miss Islington (bot)
562c168856
[3.11] gh-89392: Fix running test_pep646_syntax as script (GH-108875) (GH-108877)
(cherry picked from commit f3b6608ba2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-05 06:41:15 +00:00
Serhiy Storchaka
3fd6ada2e6
[3.11] bpo-45229: Make ElementTree tests discoverable (GH-108859) (GH-108874)
(cherry picked from commit 074ac1f72e)
2023-09-04 10:43:12 +00:00
Miss Islington (bot)
723ca8c387
[3.11] gh-89392: Remove test_main() in test_netrc (GH-108860) (GH-108868)
(cherry picked from commit 76f3c043b6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-04 10:20:24 +00:00
Miss Islington (bot)
75df36e0d5
[3.11] gh-89392: Make test_pep646_syntax discoverable (GH-108861) (GH-108869)
(cherry picked from commit d0b22f6bd8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-04 13:11:33 +03:00
Victor Stinner
79f7a4c0a4
[3.11] gh-108822: Backport libregrtest changes from the main branch (#108820)
* Revert "[3.11] gh-101634: regrtest reports decoding error as failed test (#106169) (#106175)"

This reverts commit d5418e97fc.

* Revert "[3.11] bpo-46523: fix tests rerun when `setUp[Class|Module]` fails (GH-30895) (GH-103342)"

This reverts commit ecb09a8496.

* Revert "gh-95027: Fix regrtest stdout encoding on Windows (GH-98492)"

This reverts commit b2aa28eec5.

* Revert "[3.11] gh-94026: Buffer regrtest worker stdout in temporary file (GH-94253) (GH-94408)"

This reverts commit 0122ab235b.

* Revert "Run Tools/scripts/reindent.py (GH-94225)"

This reverts commit f0f3a424af.

* Revert "gh-94052: Don't re-run failed tests with --python option (GH-94054)"

This reverts commit 1347607db1.

* Revert "[3.11] gh-84461: Fix Emscripten umask and permission issues (GH-94002) (GH-94006)"

This reverts commit 1073184918.

* gh-93353: regrtest checks for leaked temporary files (#93776)

When running tests with -jN, create a temporary directory per process
and mark a test as "environment changed" if a test leaks a temporary
file or directory.

(cherry picked from commit e566ce5496)

* gh-93353: Fix regrtest for -jN with N >= 2 (GH-93813)

(cherry picked from commit 36934a16e8)

* gh-93353: regrtest supports checking tmp files with -j2 (#93909)

regrtest now also implements checking for leaked temporary files and
directories when using -jN for N >= 2. Use tempfile.mkdtemp() to
create the temporary directory. Skip this check on WASI.

(cherry picked from commit 4f85cec9e2)

* gh-84461: Fix Emscripten umask and permission issues (GH-94002)

- Emscripten's default umask is too strict, see
  https://github.com/emscripten-core/emscripten/issues/17269
- getuid/getgid and geteuid/getegid are stubs that always return 0
  (root). Disable effective uid/gid syscalls and fix tests that use
  chmod() current user.
- Cannot drop X bit from directory.

(cherry picked from commit 2702e408fd)

* gh-94052: Don't re-run failed tests with --python option (#94054)

(cherry picked from commit 0ff7b996f5)

* Run Tools/scripts/reindent.py (#94225)

Reindent files which were not properly formatted (PEP 8: 4 spaces).

Remove also some trailing spaces.

(cherry picked from commit e87ada48a9)

* gh-94026: Buffer regrtest worker stdout in temporary file (GH-94253)

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 199ba23324)

* gh-96465: Clear fractions hash lru_cache under refleak testing (GH-96689)

Automerge-Triggered-By: GH:zware
(cherry picked from commit 9c8f379433)

* gh-95027: Fix regrtest stdout encoding on Windows (#98492)

On Windows, when the Python test suite is run with the -jN option,
the ANSI code page is now used as the encoding for the stdout
temporary file, rather than using UTF-8 which can lead to decoding
errors.

(cherry picked from commit ec1f6f5f13)

* gh-98903: Test suite fails with exit code 4 if no tests ran (#98904)

The Python test suite now fails wit exit code 4 if no tests ran. It
should help detecting typos in test names and test methods.

* Add "EXITCODE_" constants to Lib/test/libregrtest/main.py.
* Fix a typo: "NO TEST RUN" becomes "NO TESTS RAN"

(cherry picked from commit c76db37c0d)

* gh-100086: Add build info to test.libregrtest (#100093)

The Python test runner (libregrtest) now logs Python build information like
"debug" vs "release" build, or LTO and PGO optimizations.

(cherry picked from commit 3c89202247)

* bpo-46523: fix tests rerun when `setUp[Class|Module]` fails (#30895)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 995386071f)

* gh-82054: allow test runner to split test_asyncio to execute in parallel by sharding. (#103927)

This runs test_asyncio sub-tests in parallel using sharding from Cinder. This suite is typically the longest-pole in runs because it is a test package with a lot of further sub-tests otherwise run serially. By breaking out the sub-tests as independent modules we can run a lot more in parallel.

After porting we can see the direct impact on a multicore system.

Without this change:
  Running make test is 5 min 26 seconds
With this change:
  Running make test takes 3 min 39 seconds

That'll vary based on system and parallelism. On a `-j 4` run similar to what CI and buildbot systems often do, it reduced the overall test suite completion latency by 10%.

The drawbacks are that this implementation is hacky and due to the sorting of the tests it obscures when the asyncio tests occur and involves changing CPython test infrastructure but, the wall time saved it is worth it, especially in low-core count CI runs as it pulls a long tail. The win for productivity and reserved CI resource usage is significant.

Future tests that deserve to be refactored into split up suites to benefit from are test_concurrent_futures and the way the _test_multiprocessing suite gets run for all start methods. As exposed by passing the -o flag to python -m test to get a list of the 10 longest running tests.

---------

Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google, LLC]
(cherry picked from commit 9e011e7c77)

* Display the sanitizer config in the regrtest header. (#105301)

Display the sanitizers present in libregrtest.

Having this in the CI output for tests with the relevant environment
variable displayed will help make it easier to do what we need to
create an equivalent local test run.

(cherry picked from commit 852348ab65)

* gh-101634: regrtest reports decoding error as failed test (#106169)

When running the Python test suite with -jN option, if a worker stdout
cannot be decoded from the locale encoding report a failed testn so the
exitcode is non-zero.

(cherry picked from commit 2ac3eec103)

* gh-108223: test.pythoninfo and libregrtest log Py_NOGIL (#108238)

Enable with --disable-gil --without-pydebug:

    $ make pythoninfo|grep NOGIL
    sysconfig[Py_NOGIL]: 1

    $ ./python -m test
    ...
    == Python build: nogil debug
    ...

(cherry picked from commit 5afe0c17ca)

* gh-90791: test.pythoninfo logs ASAN_OPTIONS env var (#108289)

* Cleanup libregrtest code logging ASAN_OPTIONS.
* Fix a typo on "ASAN_OPTIONS" vs "MSAN_OPTIONS".

(cherry picked from commit 3a1ac87f8f)

* gh-108388: regrtest splits test_asyncio package (#108393)

Currently, test_asyncio package is only splitted into sub-tests when
using command "./python -m test". With this change, it's also
splitted when passing it on the command line:
"./python -m test test_asyncio".

Remove the concept of "STDTESTS". Python is now mature enough to not
have to bother with that anymore. Removing STDTESTS simplify the
code.

(cherry picked from commit 174e9da083)

* regrtest computes statistics (#108793)

test_netrc, test_pep646_syntax and test_xml_etree now return results
in the test_main() function.

Changes:

* Rewrite TestResult as a dataclass with a new State class.
* Add test.support.TestStats class and Regrtest.stats_dict attribute.
* libregrtest.runtest functions now modify a TestResult instance
  in-place.
* libregrtest summary lists the number of run tests and skipped
  tests, and denied resources.
* Add TestResult.has_meaningful_duration() method.
* Compute TestResult duration in the upper function.
* Use time.perf_counter() instead of time.monotonic().
* Regrtest: rename 'resource_denieds' attribute to 'resource_denied'.
* Rename CHILD_ERROR to MULTIPROCESSING_ERROR.
* Use match/case syntadx to have different code depending on the
  test state.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit d4e534cbb3)

* gh-108822: Add Changelog entry for regrtest statistics (#108821)

---------

Co-authored-by: Christian Heimes <christian@python.org>
Co-authored-by: Zachary Ware <zach@python.org>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Joshua Herman <zitterbewegung@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-09-03 19:21:53 +02:00
Miss Islington (bot)
ba47d87282
[3.11] Reorder some test's decorators (GH-108804) (GH-108845)
For example, do not demand the 'cpu' resource if the test cannot be run
due to non-working threads.
(cherry picked from commit 509bb61977)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-03 13:01:49 +00:00
Serhiy Storchaka
76f52196b9
[3.11] gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421) (GH-108799)
Only mark tests which spend significant system or user time,
by itself or in subprocesses.
(cherry picked from commit f3ba0a74cd)
2023-09-03 09:34:30 +03:00
Miss Islington (bot)
fc114a72bc
[3.11] gh-103186: assert in tests that UnsafeMailcapInput warnings are provided (GH-103217) (GH-108800)
(cherry picked from commit 1724553e6e)

Co-authored-by: Ijtaba Hussain <ijtabahussain@live.com>
2023-09-02 05:53:48 +00:00
Miss Islington (bot)
385b1952f0
[3.11] gh-108520: Fix bad fork detection in nested multiprocessing use case (GH-108568) (#108692)
gh-107275 introduced a regression where a SemLock would fail being passed along nested child processes, as the `is_fork_ctx` attribute would be left missing after the first deserialization.

---------

(cherry picked from commit add8d45cbe)

Co-authored-by: albanD <desmaison.alban@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
2023-08-30 22:36:26 +02:00
Erlend E. Aasland
6f24420cbf
[3.11] gh-108590: Revert gh-108657 (commit 400a1cebc) (#108686) (#108694)
(cherry picked from commit 2a3926fa51)

Reverted per Serhiy's request.
2023-08-30 20:12:10 +00:00
Corvin
5a6d1238bb
[3.11] gh-108590: Fix sqlite3.iterdump for invalid Unicode in TEXT columns (GH-108657) (#108674)
(cherry picked from commit 400a1cebc7)
2023-08-30 12:29:33 +02:00
Serhiy Storchaka
2e4c3efec1
[3.11] Revert "[3.11] Use non alternate name for Kyiv (GH-108533) (GH-108641)" (GH-108650)
This reverts commit 34f84f2b9f.

It broke tests on the Debian and macOS buildbots.
2023-08-29 23:09:20 +03:00
Miss Islington (bot)
34f84f2b9f
[3.11] Use non alternate name for Kyiv (GH-108533) (GH-108641)
tzdata provides Kiev as an alternative to Kyiv:

https://sources.debian.org/src/tzdata/2023c-10/backward/?hl=314GH-L314

But Debian moved it to the tzdata-legacy package breaking the test:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050530

This patch switches to the name provided by tzdata.
(cherry picked from commit 7659128b9d)

Co-authored-by: Jochen Sprickerhof <github@jochen.sprickerhof.de>
2023-08-29 15:47:54 +00:00
Miss Islington (bot)
cc12c965af
[3.11] gh-108558: Improve sqlite3 row factory tests (GH-108578) (#108616)
Add test_sqlite_row_keys() to explicitly test sqlite3.Row.keys().

Cleanups:
- Reduce test noise by converting docstrings to regular comments
- Reduce boilerplate code by adding a setUp() method to RowFactoryTests

(cherry picked from commit 6eaddc10e9)

Co-authored-by: Edward Schauman-Haigh <142528725+EddInSverige@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-08-29 09:47:27 +00:00
Miss Islington (bot)
ed749be3aa
[3.11] gh-105821: Use a raw f-string in test_httpservers.py (GH-105822) (#108576)
gh-105821: Use a raw f-string in test_httpservers.py (GH-105822)

Use a raw f-string in test_httpservers.py
(cherry picked from commit 09ce8c3b48)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-08-28 17:44:13 +00:00