Skip to content

Commit 46354cc

Browse files
committed
fixed pytest postgresql conn err
1 parent f89fdf6 commit 46354cc

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/conftest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import os
2+
# Set a dummy database before importing main.py so it doesn't attempt to connect to PostgreSQL!
3+
os.environ["DATABASE_URL"] = "sqlite:///:memory:"
4+
15
import pytest
26
from fastapi.testclient import TestClient
37
from sqlalchemy import create_engine

0 commit comments

Comments
 (0)