{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/6"}],"enrichment":{"capability":"Provides pytest fixtures that spin up isolated database services in Docker containers for testing, supporting Postgres, MySQL, Oracle, SQL Server, Redis, Elasticsearch, and other databases.","skillfed_tags":["docker-integration","database-testing","fixtures"],"use_cases":["Integration testing a web application against a real Postgres or MySQL database without manual container management.","Testing database migrations and schema changes against multiple database versions in parallel CI jobs.","Validating ORM queries and raw SQL against Oracle or SQL Server in a containerized test environment.","Testing Redis or Elasticsearch client code with a real service instance isolated per test run.","Verifying multi-database support in a library by running the same test suite against Postgres, MySQL, and CockroachDB fixtures."],"what_it_does":"pytest-databases is a pytest plugin that provides ready-made fixtures for running database services in Docker containers during tests. Instead of mocking or using in-memory databases, it lets you test against real database instances\u2014Postgres, MySQL, Oracle, SQL Server, Redis, Elasticsearch, and others\u2014each isolated in its own container. The plugin handles container startup, configuration, and teardown automatically.\n\nYou declare which database you want in your conftest.py, then inject the service fixture into your test functions. The fixture exposes connection details (host, port, user, password, database name) so you can connect with your normal database client library. This approach trades setup time for test fidelity: your tests run against the actual database engine, not a mock, catching real schema and driver issues before production.","worth_installing":"Yes, if you need real database testing in a containerized environment. The low install friction, active maintenance, permissive license, and broad database support make it a solid choice for integration tests. The main gotcha is the Docker dependency\u2014you must have Docker running, and container startup adds latency per test. For unit tests or projects that cannot use Docker, this is not the right tool."},"id":"pytest-databases","links":{"html":"https://skillfed.io/packages/pytest-databases","md":"https://skillfed.io/packages/pytest-databases.md","pypi":"https://pypi.org/project/pytest-databases/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-05-23","license_spdx":"MIT","license_treatment":"permissive","name":"pytest-databases","python_support":"supports_current","summary":"Reusable database fixtures for any and all databases."},"popularity":{"monthly_downloads":74438,"position":14830,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.19.0"}
