diff --git a/trolldb/tests/conftest.py b/trolldb/tests/conftest.py index edb8ee7..ffb7312 100644 --- a/trolldb/tests/conftest.py +++ b/trolldb/tests/conftest.py @@ -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 @@ -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