--- id: testcontainers-core version: "0.0.1rc1" license: unclear license_treatment: unclear maintenance: active --- # testcontainers-core — Core component of testcontainers-python. License: unclear · Maintenance: active · Downloads: 341.4K/mo ## What it is and what it does testcontainers-core is the foundation of the testcontainers-python library, enabling developers to use Docker containers as ephemeral test fixtures for integration and functional testing. Instead of managing database instances or other services manually, you define containers declaratively in your test code and they start and stop with your test lifecycle. The package wraps Docker's API and provides container lifecycle management through Python context managers. It handles resource cleanup automatically and includes ryuk, a sidecar container that ensures dangling test containers are reaped even if tests crash. With only docker and wrapt as runtime dependencies, it has minimal overhead and integrates naturally into test frameworks. Use it for: - Spin up a PostgreSQL database for each test run without manual provisioning or teardown. - Test application code against a real service instance in isolation without affecting other tests. - Verify database migrations and schema changes in a fresh container for each test suite run. - Integration test services by launching dependent containers on demand. - Validate application behavior against specific service versions by pulling different container images per test. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Docker container orchestration for functional and integration testing, allowing tests to spin up isolated service containers on demand without manual setup. Yes, with conditions. The package is actively maintained and widely used, with no known vulnerabilities. However, it is still at release candidate stage (0.0.1rc1) with no stable release, and its license is unclear in the metadata. Install it for testing workflows if you accept pre-release stability and can verify the license separately; avoid it in production code or strict license-compliance environments until a stable release and clear license terms are published. ## Install pip install testcontainers-core uv add testcontainers-core poetry add testcontainers-core ## Installing testcontainers-core Before you install: Low install friction with only two runtime dependencies (docker and wrapt). Actively maintained with recent commits; however, the package is at release candidate stage (0.0.1rc1) and has not had a stable release since its initial 2023-01-06 date, which may warrant caution in production environments. License in practice: License status is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license terms before adopting this package in a commercial or restricted-license project. Quickstart: pip install testcontainers-core from testcontainers.postgres import PostgresContainer with PostgresContainer("postgres:16") as postgres: connection_url = postgres.get_connection_url() Requires Docker daemon to be running and accessible; tests will fail if Docker is not installed or the daemon is not reachable. Verify before relying: - Whether the package has an official stable release or if 0.0.1rc1 is the current recommended version for production use. - The actual license under which testcontainers-core is distributed, given the unclear license_treatment in metadata. - Support scope and compatibility for container runtimes beyond Docker (e.g., Podman). - Full range of supported container types beyond PostgreSQL mentioned in the description excerpt. ## Package facts - License: not declared (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 341.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags docker containers for testing, integration test containers, testcontainers python, functional testing with docker, isolated test databases, containerized test services, test fixture containers, docker-integration, test-fixtures, container-management [View on SkillFed](https://skillfed.io/packages/testcontainers-core) · [View on PyPI](https://pypi.org/project/testcontainers-core/)