add set of unit tests

This commit is contained in:
grillazz
2021-03-28 17:12:35 +02:00
parent 786bb23eab
commit c3fc4e3146
5 changed files with 102 additions and 9 deletions

View File

@@ -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)