Title: Support setting the loop_factory in IsolatedAsyncioTestCase · Issue #110774 · python/cpython · GitHub
Open Graph Title: Support setting the loop_factory in IsolatedAsyncioTestCase · Issue #110774 · python/cpython
X Title: Support setting the loop_factory in IsolatedAsyncioTestCase · Issue #110774 · python/cpython
Description: Proposal: I want to be able to create utility subclasses of IsolatedAsyncioTestCase that use either uvloop or a specific event loop using the asyncio.Runner(..., loop_factory=...) kwarg, Ideally it would look something like: Another adva...
Open Graph Description: Proposal: I want to be able to create utility subclasses of IsolatedAsyncioTestCase that use either uvloop or a specific event loop using the asyncio.Runner(..., loop_factory=...) kwarg, Ideally it...
X Description: Proposal: I want to be able to create utility subclasses of IsolatedAsyncioTestCase that use either uvloop or a specific event loop using the asyncio.Runner(..., loop_factory=...) kwarg, Ideally it...
Opengraph URL: https://github.com/python/cpython/issues/110774
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support setting the loop_factory in IsolatedAsyncioTestCase","articleBody":"### Proposal:\r\n\r\nI want to be able to create utility subclasses of `IsolatedAsyncioTestCase` that use either uvloop or a specific event loop using the `asyncio.Runner(..., loop_factory=...)` kwarg, Ideally it would look something like:\r\n\r\nAnother advantage of setting `loop_factory` would allow use of `IsolatedAsyncioTestCase` without using `def tearDownModule(): asyncio.set_event_loop_policy(None)` because `asyncio.Runner` does not call `asyncio.get_event_loop_policy()` when called with a `loop_factory`\r\n\r\n```python\r\nclass DefaultIsolatedAsyncioTestCase:\r\n \"\"\"\r\n Use the most efficient event loop regardless of what has been configured with asyncio.set_event_loop_policy\r\n does not require `def tearDownModule(): asyncio.set_event_loop_policy(None)`\r\n \"\"\"\r\n loop_factory = asyncio.EventLoop\r\n```\r\n\r\nor\r\n\r\n```python\r\nclass UvloopIsolatedAsyncioTestCase:\r\n \"\"\"\r\n runs tests on uvloop\r\n \"\"\"\r\n loop_factory = uvloop.new_event_loop\r\n```\r\n\r\n### Has this already been discussed elsewhere?\r\n\r\nI have already discussed this feature proposal on Discourse\r\n\r\n### Links to previous discussion of this feature:\r\n\r\nhttps://discuss.python.org/t/support-setting-the-loop-factory-in-isolatedasynciotestcase/36027\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-110776\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/graingert","@type":"Person","name":"graingert"},"datePublished":"2023-10-12T15:02:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/110774/cpython/issues/110774"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e929716d-cdf7-3cb2-e383-054b53da31e8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B2BC:1EEB64:D7FF88:1277319:6969ED38 |
| html-safe-nonce | 65d4ab48b288dcfc61c941b7c6cd1e272e96e547282b280094e9f14f9d204a17 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMkJDOjFFRUI2NDpEN0ZGODg6MTI3NzMxOTo2OTY5RUQzOCIsInZpc2l0b3JfaWQiOiI2OTY3MDcyMDY4NjExNTU2NDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 84c1ab5e3fad82a2d710399a8f01d21f17a32def6f540350de736f13ccdfc1fb |
| hovercard-subject-tag | issue:1940192688 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/110774/issue_layout |
| twitter:image | https://opengraph.githubassets.com/84088cf83689fd4c8a33f25563e12648eafcbed8d7db497524978f9eba349efd/python/cpython/issues/110774 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/84088cf83689fd4c8a33f25563e12648eafcbed8d7db497524978f9eba349efd/python/cpython/issues/110774 |
| og:image:alt | Proposal: I want to be able to create utility subclasses of IsolatedAsyncioTestCase that use either uvloop or a specific event loop using the asyncio.Runner(..., loop_factory=...) kwarg, Ideally it... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | graingert |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width