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.4.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.4-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_mongo_docker-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 1c474d4edc784f07ad3b2f532f48da7ac8e05458b8bd6852e815a81b4c7ad335
MD5 31bcd3935acbd3c37d49f57018312ffb
BLAKE2b-256 45cf601e5785fdfd24938c1cc8155ff043387ba9869574d438178b4227c95bab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytest_mongo_docker-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0547bb8d59f1a176a12dec8c760b640e0ea755f5ca78783ef2af903733f721d0
MD5 0906f6b48bcdf723381fb6e400f92cde
BLAKE2b-256 71bd2cc869515e690f33ba1029cc7c99722e00918175e81d295e8dfaabcc061a

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