Files
onever_drive/tests/conftest.py
T

11 lines
372 B
Python

import pytest_asyncio
from app.core.database import engine, Base
@pytest_asyncio.fixture(autouse=True)
async def clean_database():
"""Drops and re-creates all tables before each test for total test isolation."""
async with engine.begin() as conn:
await conn.run_sync(Base.metadata.drop_all)
await conn.run_sync(Base.metadata.create_all)
yield