Skip to content

asyncio marker works if no event loop is set #65

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

Closed
wants to merge 1 commit into from

Conversation

argaen
Copy link

@argaen argaen commented Sep 8, 2017

There is at least one edge case where there is no event loop when https://github.com/pytest-dev/pytest-asyncio/compare/master...argaen:catch_when_no_loop?expand=1#diff-4d85e8313d8e67cb777137411a11ac86R133 is reached.

When combining pytest-aiohttp and this package (only with 0.6.0 version) tests are crashing saying there is no event loop running. I believe the error is produced because pytest-aiohttp does the following: https://github.com/aio-libs/aiohttp/blob/master/aiohttp/pytest_plugin.py#L145 and then when pytest-asyncio reaches the line where it has to get the loop, there is no loop. This PR provides a try/except for controlling this case.

I was checking previous versions of this package to see why it wasn't crashing but from what I can see it has changed quite a lot

@argaen
Copy link
Author

argaen commented Sep 8, 2017

Oh well, closing in favor of #64

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

Successfully merging this pull request may close these issues.

1 participant