{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/3"}],"enrichment":{"capability":"Provides pytest fixtures that spin up real database and service containers (PostgreSQL, MySQL, Redis, MongoDB, etc.) for integration testing, eliminating the need to mock database queries.","skillfed_tags":["pytest-plugin","integration-testing","docker-fixtures"],"use_cases":["Test sqlalchemy ORM queries with real joins and eager loading to verify query correctness before deployment.","Validate data access layers against actual PostgreSQL or MySQL schemas without mocking database calls.","Test Redis or MongoDB integration code with real container instances that reflect production behavior.","Run integration tests in CI/CD pipelines where each test gets a fresh, isolated database state.","Develop tests for Redshift-specific features like COPY/UNLOAD commands using a compatible fixture.","Catch N+1 query problems and lazy-loading bugs that mock-based tests would not surface."],"what_it_does":"pytest-mock-resources is a pytest plugin that manages the lifecycle of containerized databases and services for testing. Instead of mocking database calls or maintaining a shared test database, it spins up isolated real instances (PostgreSQL, MySQL, Redis, MongoDB, SQLite, Redshift, Moto) in Docker containers, tears them down after each test, and provides them as pytest fixtures. This lets you write tests that execute actual queries against a real schema, catching bugs that mocks would miss\u2014like incorrect joins, N+1 queries, or schema mismatches\u2014while keeping tests isolated and reproducible across machines.\n\nThe package assumes you're using pytest and have Docker available. It handles container startup, teardown, and provides a session object (for SQL databases via sqlalchemy) or client (for NoSQL/cache stores) that you inject into your test functions. It supports both synchronous and async fixtures, making it suitable for modern async test suites.","worth_installing":"Yes, if you write integration tests for code that queries databases or interacts with services. The low install friction, active maintenance, permissive license, and absence of known vulnerabilities make it a solid choice. The Docker requirement is a real constraint for some environments, but for standard development and CI setups it is straightforward. Use it when mocking database calls is insufficient and you need to test actual query logic."},"id":"pytest-mock-resources","links":{"html":"https://skillfed.io/packages/pytest-mock-resources","md":"https://skillfed.io/packages/pytest-mock-resources.md","pypi":"https://pypi.org/project/pytest-mock-resources/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-09-17","license_spdx":null,"license_treatment":"permissive","name":"pytest-mock-resources","python_support":"supports_current","summary":"A pytest plugin for easily instantiating reproducible mock resources."},"popularity":{"monthly_downloads":312380,"position":7725,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"2.12.4"}
