Future Pending Exception when Using dependency_override in Main DB in async #11495
naveen-ravi2810
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Stack:
FastAPI, PostgreSQL, SQLModel, Pytest
The application is in Async programming.
when I run my tests with the main DB without the dependency_override with test_db the test is passed. But when I write dependency_override with my test_db Future Pending is happened.
Conftest_link: https://github.com/naveen-ravi2810/Conduct_Backend/blob/main/tests/conftest.py
Error: Task <Task pending name='starlette.middleware.base.BaseHTTPMiddleware.call..call_next..coro' coro=<BaseHTTPMiddleware.call..call_next..coro() running at /home/naveen/.cache/pypoetry/virtualenvs/backend-5tg4n6pO-py3.11/lib/python3.11/site-packages/starlette/middleware/base.py:151> cb=[TaskGroup._spawn..task_done() at /home/naveen/.cache/pypoetry/virtualenvs/backend-5tg4n6pO-py3.11/lib/python3.11/site-packages/anyio/_backends/_asyncio.py:699]> got Future attached to a different loop
Beta Was this translation helpful? Give feedback.
All reactions