Refactor database connection to use settings and improve test isolation with temporary DB

This commit is contained in:
2026-03-02 16:18:02 +02:00
parent 9dfa1da619
commit 27bc736981
5 changed files with 32 additions and 22 deletions
-1
View File
@@ -21,7 +21,6 @@ logger = logging.getLogger(__name__)
# Database connection setup
@asynccontextmanager
async def lifespan(app: FastAPI):
conn = sqlite3.connect('urls.db')
conn = sqlite3.connect(settings.database_url)
conn.execute("""
CREATE TABLE IF NOT EXISTS urls (