import pytest
from typing import Generator
from app.core.database import MongoDBClient 
from app.core.config import config as Config 

@pytest.fixture(scope="session", autouse=True)
def mongodb_client() -> Generator[MongoDBClient, None, None]:
    client = MongoDBClient()

    yield client

    db_name = Config.MONGO_DB 

    client.clearDb(db_name)

    client.close()

