PamGram/tests/integration/test_database.py

22 lines
505 B
Python
Raw Normal View History

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-25 03:17:38 +00:00
async def test_init_create_all(database):
async with database.engine.begin() as conn:
await conn.run_sync(SQLModel.metadata.drop_all)
await conn.run_sync(SQLModel.metadata.create_all)