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
__main__.py
echo.py
echo2.py
echo3.py
functional.py
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
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
test_queues.py
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
test_ssl.py gh-102515: Remove unused imports in the Lib/ directory (#102516) 2023-03-08 11:45:38 +00:00
test_sslproto.py
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
test_timeouts.py gh-102780: Fix uncancel() call in asyncio timeouts (#102815) 2023-03-22 10:52:10 -07:00
test_transports.py
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
utils.py gh-102799: use sys.exception() instead of sys.exc_info() in tests (#103293) 2023-04-06 11:08:25 +01:00