File: conftest.py

package info (click to toggle)
python-beanie 2.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,480 kB
  • sloc: python: 14,427; makefile: 7; sh: 6
file content (19 lines) | stat: -rw-r--r-- 372 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import pytest

from beanie import init_beanie
from beanie.migrations.models import MigrationLog


@pytest.fixture(autouse=True)
async def init(db):
    await init_beanie(
        database=db,
        document_models=[
            MigrationLog,
        ],
    )


@pytest.fixture(autouse=True)
async def remove_migrations_log(db, init):
    await MigrationLog.delete_all()