mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2025-08-19 07:21:31 +08:00

* Update tests structure. * Unit tests use the test database * Add function for creating database engine and session.
17 lines
434 B
Python
17 lines
434 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
import sys
|
|
|
|
sys.path.append('../../')
|
|
|
|
import asyncio
|
|
|
|
from backend.app.init_test_data import InitTestData
|
|
from backend.app.tests.utils.db_mysql import async_db_session, create_table
|
|
|
|
if __name__ == '__main__':
|
|
init = InitTestData(session=async_db_session)
|
|
loop = asyncio.get_event_loop()
|
|
loop.run_until_complete(create_table())
|
|
loop.run_until_complete(init.init_data())
|