2023-03-14 01:27:22 +00:00
|
|
|
import logging
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
from sqlmodel import SQLModel
|
|
|
|
|
|
|
|
from core.services.players.models import PlayersDataBase
|
|
|
|
|
|
|
|
logger = logging.getLogger()
|
|
|
|
logger.info("%s", PlayersDataBase.__name__)
|
|
|
|
|
|
|
|
|
|
|
|
# noinspection PyShadowingNames
|
|
|
|
@pytest.mark.asyncio
|
2023-03-25 03:17:38 +00:00
|
|
|
async def test_mysql(database):
|
|
|
|
assert database
|
2023-03-14 01:27:22 +00:00
|
|
|
|
|
|
|
|
2023-03-25 03:17:38 +00:00
|
|
|
async def test_init_create_all(database):
|
|
|
|
async with database.engine.begin() as conn:
|
2023-03-14 01:27:22 +00:00
|
|
|
await conn.run_sync(SQLModel.metadata.drop_all)
|
|
|
|
await conn.run_sync(SQLModel.metadata.create_all)
|