step 2 with basic crud implemented

This commit is contained in:
2026-04-19 12:36:55 +02:00
parent dae7a60eab
commit 57800f2123
16 changed files with 1113 additions and 110 deletions
+11 -1
View File
@@ -2,8 +2,9 @@ from pathlib import Path
import pytest
from fastapi.testclient import TestClient
from sqlalchemy.orm import Session
from app.db import configure_database
from app.db import SessionLocal, configure_database
from app.main import create_app
@@ -17,3 +18,12 @@ def client(tmp_path: Path):
with TestClient(app) as test_client:
yield test_client
@pytest.fixture
def db_session(client) -> Session:
db = SessionLocal()
try:
yield db
finally:
db.close()