Skip to content

Lazy import either 'anyio' or 'trio'#639

Merged
lovelydinosaur merged 4 commits intomasterfrom
lazy-import-anyio-or-trio
Dec 12, 2022
Merged

Lazy import either 'anyio' or 'trio'#639
lovelydinosaur merged 4 commits intomasterfrom
lazy-import-anyio-or-trio

Conversation

@lovelydinosaur
Copy link
Copy Markdown
Contributor

Closes #626

example.py

import trio
import httpcore

async def main():
    async with httpcore.AsyncConnectionPool() as http:
        response = await http.request("GET", "https://www.example.com/")
        print(response)


trio.run(main)
$ pip install httpcore, trio
$ pip uninstall anyio
$ python example.py
<Response [200]>

Turns out this doesn't fix the #588 conflict, which is still triggered by the usage of @pytest.mark.anyio in the test suite. 🤷‍♂️

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid importing/using anyio when trio backend is being used.

2 participants