Skip to content

Commit

Permalink
More docstrings!
Browse files Browse the repository at this point in the history
  • Loading branch information
pkhalaj committed May 16, 2024
1 parent abf0354 commit 9ef3340
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions trolldb/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
This module provides fixtures for running a Mongo DB instance in test mode and filling the database with test data.
"""


import pytest
import pytest_asyncio

Expand All @@ -16,32 +15,22 @@

@pytest.fixture(scope="session")
def _run_mongodb_server_instance():
"""Documentation to be added!"""
"""Encloses all tests (session scope) in a context manager of a running MongoDB instance (in a separate process)."""
with mongodb_instance_server_process_context():
yield


@pytest.fixture(scope="session")
def _test_server_fixture(_run_mongodb_server_instance):
"""Documentation to be added!"""
"""Encloses all tests (session scope) in a context manager of a running API server (in a separate process)."""
TestDatabase.prepare()
with server_process_context(test_app_config, startup_time=2000):
yield


@pytest.fixture(scope="session")
def _run_mongodb_server_instance():
"""Runs the MongoDB instance in test mode using a context manager.
It is run once for all tests in this test suite.
"""
with mongodb_instance_server_process_context():
yield


@pytest_asyncio.fixture()
async def mongodb_fixture(_run_mongodb_server_instance):
"""Fills the database with test data and then runs the mongodb client using a context manager."""
"""Fills the database with test data and then enclose each test in a mongodb context manager."""
TestDatabase.prepare()
async with mongodb_context(test_app_config.database):
yield

0 comments on commit 9ef3340

Please sign in to comment.