Skip to content
This repository has been archived by the owner on Jun 25, 2018. It is now read-only.

Test tokio with other libraries #34

Open
jettify opened this issue May 10, 2017 · 10 comments
Open

Test tokio with other libraries #34

jettify opened this issue May 10, 2017 · 10 comments

Comments

@jettify
Copy link

jettify commented May 10, 2017

@fafhrd91
Copy link
Collaborator

fafhrd91 commented May 10, 2017 via email

@jettify
Copy link
Author

jettify commented May 10, 2017

With tokio loop I am getting bunch of errors RuntimeError: Timeout context manager should be used inside a task when using loop.run_until_complete(coro) as result tests does not have a chance to start since such idiom ofter used in test fixtures. (asyncio and uvloop works as expected)

    @pytest.fixture
    def bucket_name(region, create_bucket, s3_client, loop):
>       name = loop.run_until_complete(create_bucket(region))
E       RuntimeError: Timeout context manager should be used inside a task

@fafhrd91
Copy link
Collaborator

fafhrd91 commented May 10, 2017 via email

@1st1
Copy link

1st1 commented May 10, 2017

Does tokio create its own rust Tasks? Why not Futures instead?

@fafhrd91
Copy link
Collaborator

@jettify aiomonitor passes tests with aiohttp master

@fafhrd91
Copy link
Collaborator

@jettify
Copy link
Author

jettify commented May 11, 2017

I will merge those PRs soon, so tokio/uvloop can be tested on each PR continuously.

@fafhrd91
Copy link
Collaborator

@jettify I think we need separate package for various asyncio related fixtures.
every library that test different event loops implements loop fixture

@jettify
Copy link
Author

jettify commented May 13, 2017

@fafhrd91 agreed there are few libraries, but not sure I like them (https://pypi.python.org/pypi/pytest-asyncio)

@fafhrd91
Copy link
Collaborator

But we have enough fixters in aiohttp and other aio libs, we just need to extract those to separate package

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

No branches or pull requests

3 participants