mirror of
https://github.com/fastapi/fastapi.git
synced 2026-01-22 04:50:14 -05:00
📝 Add an example of setting up a test database (#1144)
* Add an example of setting up a test database. * 📝 Add/update docs for testing a DB with dependency overrides * 🔧 Update test script, remove line removing test file as it is removed during testing * ✅ Update testing coverage pragma Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
@@ -2,7 +2,7 @@ from sqlalchemy import create_engine
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
SQLALCHEMY_DATABASE_URL = "sqlite:///./test.db"
|
||||
SQLALCHEMY_DATABASE_URL = "sqlite:///./sql_app.db"
|
||||
# SQLALCHEMY_DATABASE_URL = "postgresql://user:password@postgresserver/db"
|
||||
|
||||
engine = create_engine(
|
||||
|
||||
Reference in New Issue
Block a user