fix: Update HTTP status code for unprocessable entity and improve test database setup
All checks were successful
Run Tests / test (push) Successful in 1m51s

This commit is contained in:
2025-10-25 19:26:43 +02:00
parent 5b1322ddbc
commit 75f533b87b
2 changed files with 4 additions and 1 deletions

View File

@@ -68,10 +68,13 @@ def setup_database() -> Generator[None, None, None]:
@pytest.fixture()
def db_session() -> Generator[Session, None, None]:
Base.metadata.drop_all(bind=engine)
Base.metadata.create_all(bind=engine)
session = TestingSessionLocal()
try:
yield session
finally:
session.rollback()
session.close()