Sitelet https://github.com/pytest-dev/pytest-asyncio/pull/65
Skip to content

asyncio marker works if no event loop is set - #65

Closed
argaen wants to merge 1 commit into
pytest-dev:masterfrom
argaen:catch_when_no_loop
Closed

argaen wants to merge 1 commit into
pytest-dev:masterfrom
argaen:catch_when_no_loop

Conversation

@argaen

@argaen argaen commented Sep 8, 2017

Copy link
Copy Markdown

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

argaen commented Sep 8, 2017

Copy link
Copy Markdown
Author

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