-
Notifications
You must be signed in to change notification settings - Fork 149
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
Event loop is closed #371
Comments
I stumbled upon a similar issue and solved it by combining these two solutions: #30 (comment) and encode/httpx#914 (comment) So the end result is: # content of conftest.py
import asyncio
@pytest.yield_fixture
def event_loop():
"""Create an instance of the default event loop for each test case."""
policy = asyncio.WindowsSelectorEventLoopPolicy()
res = policy.new_event_loop()
asyncio.set_event_loop(res)
res._close = res.close
res.close = lambda: None
yield res
res._close() |
I was just looking into this issue as you posted your comment. Glad you could solve it. I assume this can be closed. |
So to have it clear, is it a bug related to Python(there are some comments in the threads provided above), or is it related to pytest-asyncio? |
@farukozderim If in doubt, it's a pytest-asyncio issue. Honestly, I didn't manage to set up your example and reproduce the error. I checked out the repository, installed the requirements and downloaded >1GB of Python wheels. After that, the test still complained about missing dependencies, which I installed one by one. I stopped after the third and found your comment. No offense intended. I just wanted to point out that a more stripped down example would have been helpful. I assume it's related to the use of |
Sorry for the inconveniences, thank you for looking into it. |
While running the tests I am receiving these warning errors, and I suspect this causes CircleCI tests to run forever and not finish.
Reproduction:
Go to the Commit and run
pytest test/test_utils.py
Related issues:
#256, #291
Not sure what causes it and how to solve it, do you have any suggestions @seifertm?
The text was updated successfully, but these errors were encountered: