MongoDB process and client fixtures plugin for Pytest. Provides fixtures to start a MongoDB process and provide a pymongo client. Version 4.0.0 requires Python >=3.10 and uses the pytest-dbfixtures framework for managing MongoDB processes.
pip install pytest-mongoVerified import paths — ran on the pinned version, not inferred.
Add pytest_plugins to conftest or test file, then use mongo_client fixture directly.
Upgrade Python to 3.10+ and adjust conftest.py fixture scopes if relying on session-scoped defaults.
Set the MONGODB_BINARY environment variable to an existing mongod binary to skip download. Or use a pre-installed MongoDB in CI.
Replace pytest-mongo-dbfixtures with pytest-mongo and use mongo_proc and mongo_client.