How to set custom event loop for a single test? #1294
Unanswered
UncleGoogle
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, my case is that I have a event loop that mocks the time pass and it works on async tests only. Some of my code uses internally normal time.sleep (theads) so using this mock loop makes it hangs.
That is why I don't want to set up default/global event loop policy, just to use it for some tests, from time to time.
asyncio.set_event_loop makes it throw warnings, so it can cause side effects I guess.
A workaround would be to put some of my tests in a test class and put a event_loop_policy to be overriden in there. Any other options?
Beta Was this translation helpful? Give feedback.
All reactions