For anyone else who ended up here with the same ... is bound to a different event loop
error, but it's not related to FastAPI. Adding asyncio.new_event_loop()
within the test fixed this for me.
e.g.
@pytest.mark.asyncio
async def test_my_func():
asyncio.new_event_loop()
....