Skip to main content

A tiny plugin for pytest which runs MongoDB in Docker

Project description

Data directory is mounted to a tmpfs for speed.

How to use?

import pymongo


def test_pymongo(mongo):
    client = pymongo.MongoClient(host=mongo.host, port=mongo.port)

    db = client["test_db"]
    collection = db["test_collection"]

    collection.insert_one({"key": "value"})
    doc = collection.find_one({"key": "value"})

    assert doc["key"] == "value"

    client.close()

v0.0.1 (2026-02-11)

  • A first version

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_mongo_docker-0.0.3.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_mongo_docker-0.0.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file pytest_mongo_docker-0.0.3.tar.gz.

File metadata

  • Download URL: pytest_mongo_docker-0.0.3.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.11

File hashes

Hashes for pytest_mongo_docker-0.0.3.tar.gz
Algorithm Hash digest
SHA256 e583299fa32d82012d6d1aef2581091db439125555acc63020ec9eaab2348355
MD5 136d51534e77be29ba79bb349bdf2330
BLAKE2b-256 a772d480f089f6c0250e230be58580abc1868759199afd57167c4df7ff45d0dd

See more details on using hashes here.

File details

Details for the file pytest_mongo_docker-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_mongo_docker-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3b0efd6c6aae689d6e6a8669b08f93c82d3804d0d2e73bcd67add709a381addc
MD5 5f3a742c7212c3ca22bb129c1010fc12
BLAKE2b-256 14315ac300a305173f8bbd4d06eb502629886dda5577f289bb48847848d6b1ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page