Skip to content

Commit

Permalink
redefine engine
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshod5 committed May 23, 2024
1 parent 57a77f0 commit 79f0b40
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from fastapi.testclient import TestClient
from sqlalchemy.orm import sessionmaker
from src.api.main import app
from src.api.database import get_db
from src.api.database import get_db, engine
import os
from sqlmodel import SQLModel, create_engine
from pathlib import Path
Expand Down Expand Up @@ -32,6 +32,8 @@ def data_path(request):
host = os.environ.get("DATABASE_HOST", "localhost")
SQLALCHEMY_DATABASE_TEST_URL = f"postgresql://root:root@{host}:5432/test_db"

engine = create_engine(SQLALCHEMY_DATABASE_TEST_URL)

# Fixture to create and drop the database
@pytest.fixture(scope="session")
def test_db(data_path):
Expand Down

0 comments on commit 79f0b40

Please sign in to comment.