Issue 47062: Implement asyncio.Runner context manager (original) (raw)
Issue47062
This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
This issue has been migrated to GitHub: https://github.com/python/cpython/issues/91218
classification
Title: | Implement asyncio.Runner context manager | ||
---|---|---|---|
Type: | Stage: | resolved | |
Components: | asyncio | Versions: | Python 3.11 |
process
Status: | closed | Resolution: | fixed |
---|---|---|---|
Dependencies: | Superseder: | ||
Assigned To: | Nosy List: | asvetlov, kumaraditya, yselivanov, zach.ware | |
Priority: | normal | Keywords: | patch |
Created on 2022-03-18 20:44 by asvetlov, last changed 2022-04-11 14:59 by admin. This issue is now closed.
Pull Requests | |||
---|---|---|---|
URL | Status | Linked | Edit |
PR 31799 | merged | asvetlov,2022-03-18 20:45 | |
PR 32113 | merged | asvetlov,2022-03-25 12:03 |
Messages (5) | ||
---|---|---|
msg415527 - (view) | Author: Andrew Svetlov (asvetlov) * ![]() |
Date: 2022-03-18 20:44 |
Sometimes asyncio.run() is not enough. For example, unittest test case needs to call several async functions (setup, test, teardown) from the synchronous code using the same execution context and event loop. The proposal provides the following: with Runner() as runner: runner.run(async_func()) | ||
msg415971 - (view) | Author: Andrew Svetlov (asvetlov) * ![]() |
Date: 2022-03-24 19:51 |
New changeset 4119d2d7c9e25acd4f16994fb92d656f8b7816d7 by Andrew Svetlov in branch 'main': bpo-47062: Implement asyncio.Runner context manager (GH-31799) https://github.com/python/cpython/commit/4119d2d7c9e25acd4f16994fb92d656f8b7816d7 | ||
msg415990 - (view) | Author: Kumar Aditya (kumaraditya) * ![]() |
Date: 2022-03-25 08:36 |
With this change, Github Actions fails first time and it passes in the second rerun of running asyncio tests. See https://github.com/python/cpython/runs/5682275663?check_suite_focus=true and main branch. | ||
msg416016 - (view) | Author: Andrew Svetlov (asvetlov) * ![]() |
Date: 2022-03-25 19:59 |
I believe the error is fixed by #47118 | ||
msg416021 - (view) | Author: Andrew Svetlov (asvetlov) * ![]() |
Date: 2022-03-25 22:26 |
New changeset bad6ffaa64eecd33f4320ca31b1201b25cd8fc91 by Andrew Svetlov in branch 'main': bpo-47062: Rename factory argument to loop_factory (GH-32113) https://github.com/python/cpython/commit/bad6ffaa64eecd33f4320ca31b1201b25cd8fc91 |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:59:57 | admin | set | github: 91218 |
2022-03-25 22:26:35 | asvetlov | set | messages: + |
2022-03-25 19:59:14 | asvetlov | set | messages: + |
2022-03-25 12:03:36 | asvetlov | set | pull_requests: + <pull%5Frequest30189> |
2022-03-25 08:36:20 | kumaraditya | set | nosy: + kumaradityamessages: + |
2022-03-24 19:51:47 | asvetlov | set | status: open -> closedresolution: fixedstage: patch review -> resolved |
2022-03-24 19:51:26 | asvetlov | set | messages: + |
2022-03-21 14:46:56 | zach.ware | set | nosy: + zach.ware |
2022-03-18 20:45:28 | asvetlov | set | keywords: + patchstage: patch reviewpull_requests: + <pull%5Frequest30075> |
2022-03-18 20:44:42 | asvetlov | create |