https://github.com/python/cpython/commit/2b3b2523de41abeabfee296095fa7006b0fc8203 commit: 2b3b2523de41abeabfee296095fa7006b0fc8203 branch: 3.15 author: Miss Islington (bot) <[email protected]> committer: hugovk <[email protected]> date: 2026-09-22T11:02:39Z summary:
[3.15] gh-157788: Fix `test_long_task_name_is_truncated` by not hardcoding main task name (GH-157911) (#157941) Co-authored-by: Hugo van Kemenade <[email protected]> files: M Lib/test/test_external_inspection.py diff --git a/Lib/test/test_external_inspection.py b/Lib/test/test_external_inspection.py index 1fed0f9175e8e1..fd647153f92be6 100644 --- a/Lib/test/test_external_inspection.py +++ b/Lib/test/test_external_inspection.py @@ -447,14 +447,15 @@ def test_long_task_name_is_truncated(self): async def main(): asyncio.create_task(asyncio.sleep(10_000), name="x" * 300) await asyncio.sleep(0) - return [ + names = [ task.task_name for info in RemoteUnwinder(os.getpid()).get_all_awaited_by() for task in info.awaited_by ] + return asyncio.current_task().get_name(), names - names = asyncio.run(main()) - self.assertIn("Task-1", names) + main_name, names = asyncio.run(main()) + self.assertIn(main_name, names) self.assertEqual([len(n) for n in names if n.startswith("x")], [255]) @skip_if_not_supported _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
