cpython/Lib/test/test_asyncio
Itamar Ostricher 85c7bf5bce
gh-103793: Defer formatting task name (#103767)
The default task name is "Task-<counter>" (if no name is passed in during Task creation).
This is initialized in `Task.__init__` (C impl) using string formatting, which can be quite slow.
Actually using the task name in real world code is not very common, so this is wasted init.

Let's defer this string formatting to the first time the name is read (in `get_name` impl),
so we don't need to pay the string formatting cost if the task name is never read.

We don't change the order in which tasks are assigned numbers (if they are) --
the number is set on task creation, as a PyLong instead of a formatted string.

Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
2023-04-29 08:20:09 -07:00
..
__init__.py bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986) 2022-03-22 03:04:36 -07:00
__main__.py
echo.py
echo2.py
echo3.py
functional.py bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968) 2021-08-26 14:48:24 +02:00
test_base_events.py Fix potential flakiness in test_run_until_complete_baseexception (#100148) 2022-12-10 15:34:22 +05:30
test_buffered_proto.py
test_context.py bpo-46425: fix direct invocation of asyncio tests (#30725) 2022-01-22 13:06:27 +02:00
test_events.py GH-84559: Deprecate fork being the multiprocessing default. (#100618) 2023-02-02 15:50:35 -08:00
test_futures.py gh-101326: Fix regression when passing None to FutureIter.throw (#101327) 2023-01-25 12:01:01 -08:00
test_futures2.py GH-96764: rewrite asyncio.wait_for to use asyncio.timeout (#98518) 2023-02-17 00:18:21 +05:30
test_locks.py gh-97545: Make Semaphore run faster. (#97549) 2022-09-26 16:38:00 -07:00
test_pep492.py GH-102748: remove legacy support for generator based coroutines from asyncio.iscoroutine (#102749) 2023-03-16 20:28:10 +05:30
test_proactor_events.py gh-103607: Fix pause_reading to work when called from connection_made in asyncio. (#17425) 2023-04-27 15:33:29 +05:30
test_protocols.py Fix warning: asyncio.events._event_loop_policy was modified by test_asyncio (GH-31253) 2022-02-10 14:57:20 +02:00
test_queues.py bpo-47076: Make asyncio.Queue stable on slow test boxes (GH-32040) 2022-03-22 16:00:23 +02:00
test_runners.py GH-99388: add loop_factory parameter to asyncio.run (#99462) 2022-11-14 10:18:51 -08:00
test_selector_events.py gh-103607: Fix pause_reading to work when called from connection_made in asyncio. (#17425) 2023-04-27 15:33:29 +05:30
test_sendfile.py gh-98174: Handle EPROTOTYPE under macOS in test_sendfile_fallback_close_peer_in_the_middle_of_receiving (#98316) 2022-10-17 08:45:38 -07:00
test_server.py GH-79033: Fix asyncio.Server.wait_closed() (#98582) 2022-11-24 08:32:58 -07:00
test_sock_lowlevel.py gh-84623: Remove unused imports in tests (#93772) 2022-06-13 16:56:03 +02:00
test_ssl.py gh-102515: Remove unused imports in the Lib/ directory (#102516) 2023-03-08 11:45:38 +00:00
test_sslproto.py bpo-46198: Fix test_asyncio.test_sslproto (GH-31801) 2022-03-10 13:36:22 -08:00
test_streams.py gh-93453: No longer create an event loop in get_event_loop() (#98440) 2022-12-06 18:42:12 +01:00
test_subprocess.py gh-83925: Make asyncio.subprocess communicate similar to non-asyncio (#18650) 2023-04-27 17:30:26 -07:00
test_taskgroups.py GH-95704: Don't suppress errors from tasks when TG is cancelled (#95761) 2022-08-16 18:23:06 -07:00
test_tasks.py gh-103793: Defer formatting task name (#103767) 2023-04-29 08:20:09 -07:00
test_threads.py bpo-47104: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase (GH-32086) 2022-03-23 23:17:07 +02:00
test_timeouts.py gh-102780: Fix uncancel() call in asyncio timeouts (#102815) 2023-03-22 10:52:10 -07:00
test_transports.py Fix warning: asyncio.events._event_loop_policy was modified by test_asyncio (GH-31253) 2022-02-10 14:57:20 +02:00
test_unix_events.py gh-103780: Use patch instead of mock in asyncio unix events test (#103782) 2023-04-24 20:12:48 +00:00
test_waitfor.py GH-97546: fix flaky asyncio test_wait_for_race_condition test (#102421) 2023-03-05 12:15:22 +05:30
test_windows_events.py GH-100573: Fix server hang caused by os.stat() on named pipe (Windows) (#100959) 2023-01-13 13:24:57 -08:00
test_windows_utils.py bpo-44287: asyncio test_popen() uses longer timeout (GH-26832) 2021-06-22 01:58:19 +02:00
utils.py gh-102799: use sys.exception() instead of sys.exc_info() in tests (#103293) 2023-04-06 11:08:25 +01:00