-
Notifications
You must be signed in to change notification settings - Fork 159
possible contradictions in event_loop
documentation
#288
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
Comments
Thanks for bringing this up! I'd say some of that is no longer incorrect and we should rewrite this. Let me try to clear up the confusion:
Does that help? |
By the way, in python 3.10 In the README we do have following example: @pytest.fixture
def event_loop():
loop = MyCustomLoop()
yield loop
loop.close() In 3.9 I was using (for "session" scope) @pytest.fixture(scope="session")
def event_loop():
loop = asyncio.get_event_loop()
yield loop
loop.close()
# In 3.10:
# DeprecationWarning: There is no current event loop
# loop = asyncio.get_event_loop() Now (3.10+) it's more like that to avoid deprecation warning: @pytest.fixture(scope="session")
def event_loop():
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
yield loop
loop.close() IMO mysterious |
@rafsaf Thanks for your input! I agree with your point and I incorporated your feedback in the corresponding PR. (Note that |
I'm confused by these two parts of the event_loop section of the
README
. This wording:seems to contradict this other wording that is a little further down in the same section:
The text was updated successfully, but these errors were encountered: