-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optionally use mongomock instead of pymongo/mongodb #520
Conversation
…into mongomock
Regarding the two tests in |
…into mongomock
Hi, this is just a quick apology that this hasn't been reviewed yet. I promise to do so before the end of June! |
Merged - thanks for contributing this! |
@computron Thanks a lot for considering, reviewing and merging! |
Summary
Optionally replacing the mongodb database with a mocked (embedded) database can ease testing and tutorials for novice users. See this thread for more information.
We have performed an evaluation of several different solutions and have selected mongomock. A special package including the data persistence option to mongomock was created and included to the requirements.
Major changes:
pymongo.MongoClient
withmongomock_persistence.MongoClient
if the environment variable$MONGOMOCK_SERVERSTORE_FILE
is set or the key MONGOMOCK_SERVERSTORE_FILE in FW_Config file is set. This happens centrally infw_config.py
.pytest_mongomock
has been added for the mongomock environment has been added. The original CI jobpytest
was only renamed topytest_mongodb
and not changed. All tests are selected in thepytest_mongodb
job.mongodb
have been added to all these tests. These 13 tests are deselected in thepytest_mongomock
CI job.Todos
If this is work in progress, what else needs to be done?
Checklist
ruff
.mypy
.duecredit
@due.dcite
decorators to reference relevant papers by DOI (example)Tip: Install
pre-commit
hooks to auto-check types and linting before every commit: