Skip to main content

pymongo_inmemory

A mongo mocking library with an ephemeral MongoDB running in memory.

Usage

Insert a new section to your project's setup.cfg for the operating system and mongo version you want to spin up:

[pymongo_inmemory]
mongo_version = 4.0
operating_system = osx

then use the pymongo_inmemory client instead of original one:

from pymongo_inmemory import MongoClient

client = MongoClient()  # No need to provide host
db = client['testdb']
collection = db['test-collection']
# etc., etc.
client.close()

# Also usable with context manager
with MongoClient() as client:
    # do stuff

Development

Project is set up to develop with Pipenv.

After installing Pipenv and cloning the repo, create the shell and install all package requirements:

$> pipenv shell
$> pipenv install --dev

Create your own setup.cfg file from setup.cfg-template.

Run the tests:

$> pytest

If on NIX systems you can run further tests:

$> bash tests/integrity/test_integrity.sh

Metadata

Release files for pymongo_inmemory 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymongo_inmemory 0.1.2
File Size Uploaded
pymongo_inmemory-0.1.2.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pymongo_inmemory 0.1.2
File Interpreter ABI Platform
pymongo_inmemory-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 15.0 kB

Release files / pymongo_inmemory-0.1.2.tar.gz

Download URL pymongo_inmemory-0.1.2.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cd32d7e732e981337e9cb37a94e5cf729bdf24cc720d23104b608f0c2d376499
BLAKE2b-256 checksum
How to use checksums
f5ea2bd42157aba1123d18b8dadf9b793a88b591c4771692e47dcf876eb8df54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.9

Release files / pymongo_inmemory-0.1.2-py3-none-any.whl

Download URL pymongo_inmemory-0.1.2-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c845ba33b58c5216e7c464b89651a46f076eac9a30a512fd2d675843e836a927
BLAKE2b-256 checksum
How to use checksums
3d3bd829573d2ed2a9cc8116e5bd2a9b7d97b7d8b2cb67fd68bf183e7250913d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.9

Release history Release notifications | RSS feed

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.13

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page