mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-11-30 13:20:40 +03:00
add set of unit tests
This commit is contained in:
@@ -8,12 +8,14 @@ from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from the_app.main import app
|
||||
from the_app import config
|
||||
from the_app.database import get_db, engine
|
||||
from the_app.database import get_db
|
||||
from the_app.models.base import Base
|
||||
|
||||
from sqlalchemy.pool import NullPool
|
||||
|
||||
global_settings = config.get_settings()
|
||||
url = global_settings.asyncpg_test_url
|
||||
engine = create_async_engine(url)
|
||||
engine = create_async_engine(url, poolclass=NullPool)
|
||||
|
||||
async_session = sessionmaker(engine, expire_on_commit=False, class_=AsyncSession)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user