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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_mongo_docker-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 0c8c788179c3774c755bb8f328e5f6263ff4360a2351464f329248bd1e61726e
MD5 3e87b1f003f6587b3c59f62b67e9b21a
BLAKE2b-256 8aaa9a813c0dad339d03492134b4312c99c95576f9c7d6fe5d8e74d696eb5f78

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytest_mongo_docker-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 49c4d64c062cf9108aef9bd17431040ccff26b31812c0f2ff39f209f468fcf02
MD5 635e8c511fe64cd0e762c2027fb04a68
BLAKE2b-256 3956a46f9919ed68f5670dd5d30e93d469ed7dd8215a33ce657e23c93a932513

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