Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Reuse existing event loop if one is already running #543

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
medihack opened this issue May 13, 2023 · 1 comment
Closed

Reuse existing event loop if one is already running #543

medihack opened this issue May 13, 2023 · 1 comment

Comments

@medihack
Copy link

When I run async tests using pytest-asyncio after integration tests using playwright-pytest (only using playwright.sync_api calls), then those tests fail with the error already described in #359 . I don't know much about the internals of pytest-asyncio, but wouldn't it be possible to reuse the event loop when one is already running (and only try to start a new one when not)?

@medihack
Copy link
Author

Just as a note (to help others that stumble upon this) there is a simple workaround. Install nest_asyncio and then put this into the root conftest.py:

def pytest_configure():
    nest_asyncio.apply()

@pytest-dev pytest-dev locked and limited conversation to collaborators May 16, 2023
@seifertm seifertm converted this issue into discussion #546 May 16, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant