Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Support Curio, trio or other async libraries #356

Open
logileifs opened this issue Nov 25, 2022 · 1 comment
Open

[Feature request] Support Curio, trio or other async libraries #356

logileifs opened this issue Nov 25, 2022 · 1 comment

Comments

@logileifs
Copy link

Would you be willing to add support for Curio and/or Trio? I would submit a PR myself but I see in https://github.com/darrenburns/ward/blob/master/ward/testing.py#L200 that asyncio.run(coro) is hardcoded and I'm not sure how you would go about to make that configurable. If you could check on the user supplied config before calling asyncio.run(coro) you could do something like:

if self.is_async_test:
    coro = self.fn(**resolved_args)
    if config.asynclib == 'curio':
        import curio
        curio.run(coro)
    elif config.asynclib == 'trio':
        import trio
        trio.run(coro)
    else:
        asyncio.run(coro)
else:
    self.fn(**resolved_args)
@logileifs
Copy link
Author

I took a stab at it myself: #357

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant