Closed
Description
Long story short
When using the test_client pytest fixture and calling other functions that make use of the get_event_loop
function internally like for example asyncio.Task.current_task()
it raises the RuntimeError: There is no current event loop in thread 'MainThread'
exception.
This forces the user to pass the loop explicitly to all calls but we are forcing the user to:
- Modify the code in order to support testing with it
- Passing explicitly the loop to all calls that need it which is not always possible because the
request
object is not propagated to all the code.
Expected behaviour
Normal calls that require a loop should work without needing to pass the loop explicitly.