-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix #99: "RuntimeError: This event loop is already running" in colab and notebook #100
Fix #99: "RuntimeError: This event loop is already running" in colab and notebook #100
Conversation
…ue relevant for jupyter/colab users.
… loop is running and nest_asyncio not installed
warnings.simplefilter("ignore", category=RuntimeWarning) | ||
with pytest.raises(ModuleNotFoundError): | ||
# implicitly verify that `nest_asyncio` is not installed | ||
# this test will need to change if `nest_asyncio` becomes a requirement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to elaborate in this comment a bit more concerning the implications of nest_asyncio
becoming a requirement? I assume this test will fail is it's already installed. Would that require us to remove this test or write a new test? If nest_asyncio
became a requirement, would that remove the need for the test? If so, why not just make it a requirement now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you are correct -- if nest_asyncio
is already installed that test will fail. My thinking was to treat this dependency differently since it isn't typically required. I agree with you about the fragility of this test, I need to rethink how to test this bug fix.
@aaraney Any updates on this front? |
I should have some time this afternoon to give this more thought. Given that there is now a merge conflict, I will likely close this and ref it in a new PR that is based off the current HEAD. |
With the re-opening of this PR as #130, I am going to close this issue. |
Fixes #99
Changes
RestClient
is instantiated, try toimport nest_asyncio
and patch withnest_asyncio.apply()
. RaiseModuleNotFoundError
ifnest_asyncio
not installed.Testing
ModuleNotFoundError
is raised.Checklist