testcontainers 4.9.2
pip install testcontainers
Released:
Python library for throwaway instances of anything that can run in a Docker container
Navigation
Verified details
These details have been verified by PyPIProject links
GitHub Statistics
Maintainers
Unverified details
These details have not been verified by PyPIMeta
- License: Apache Software License
- Author: Sergey Pirogov
- Maintainer: Balint Bartha
- Tags testing, logging, docker, test automation
- Requires: Python <4.0, >=3.9
-
Provides-Extra:
arangodb
,aws
,azurite
,cassandra
,chroma
,clickhouse
,cockroachdb
,cosmosdb
,db2
,elasticsearch
,generic
,google
,influxdb
,k3s
,kafka
,keycloak
,localstack
,mailpit
,memcached
,milvus
,minio
,mongodb
,mqtt
,mssql
,mysql
,nats
,neo4j
,nginx
,ollama
,opensearch
,oracle
,oracle-free
,postgres
,qdrant
,rabbitmq
,redis
,registry
,scylla
,selenium
,sftp
,test-module-import
,trino
,vault
,weaviate
Classifiers
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Project description
Testcontainers Python
testcontainers-python
facilitates the use of Docker containers for functional and integration testing.
For more information, see the docs.
Getting Started
>>> from testcontainers.postgres import PostgresContainer
>>> import sqlalchemy
>>> with PostgresContainer("postgres:16") as postgres:
... engine = sqlalchemy.create_engine(postgres.get_connection_url())
... with engine.begin() as connection:
... result = connection.execute(sqlalchemy.text("select version()"))
... version, = result.fetchone()
>>> version
'PostgreSQL 16...'
The snippet above will spin up a postgres database in a container. The get_connection_url()
convenience method returns a sqlalchemy
compatible url we use to connect to the database and retrieve the database version.
Contributing / Development / Release
See CONTRIBUTING.md for more details.
Configuration
Env Variable | Example | Description |
---|---|---|
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE |
/var/run/docker.sock |
Path to Docker's socket used by ryuk |
TESTCONTAINERS_RYUK_PRIVILEGED |
false |
Run ryuk as a privileged container |
TESTCONTAINERS_RYUK_DISABLED |
false |
Disable ryuk |
RYUK_CONTAINER_IMAGE |
testcontainers/ryuk:0.8.1 |
Custom image for ryuk |
RYUK_RECONNECTION_TIMEOUT |
10s |
Reconnection timeout for Ryuk TCP socket before Ryuk reaps all dangling containers |
Project details
Verified details
These details have been verified by PyPIProject links
GitHub Statistics
Maintainers
Unverified details
These details have not been verified by PyPIMeta
- License: Apache Software License
- Author: Sergey Pirogov
- Maintainer: Balint Bartha
- Tags testing, logging, docker, test automation
- Requires: Python <4.0, >=3.9
-
Provides-Extra:
arangodb
,aws
,azurite
,cassandra
,chroma
,clickhouse
,cockroachdb
,cosmosdb
,db2
,elasticsearch
,generic
,google
,influxdb
,k3s
,kafka
,keycloak
,localstack
,mailpit
,memcached
,milvus
,minio
,mongodb
,mqtt
,mssql
,mysql
,nats
,neo4j
,nginx
,ollama
,opensearch
,oracle
,oracle-free
,postgres
,qdrant
,rabbitmq
,redis
,registry
,scylla
,selenium
,sftp
,test-module-import
,trino
,vault
,weaviate
Classifiers
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file testcontainers-4.9.2.tar.gz
.
File metadata
- Download URL: testcontainers-4.9.2.tar.gz
- Upload date:
- Size: 62.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 348c72d369d0bd52b57ab4f07a965ae9562837098c28f0522b969b064b779f10 |
|
MD5 | 2cac4d2d176cde88238338b566ecf41d |
|
BLAKE2b-256 | 831568cee852bcafc18827db4deb6aa0dd3b2621eb21130a522184523ef2d379 |
Provenance
The following attestation bundles were made for testcontainers-4.9.2.tar.gz
:
Publisher:
release-please.yml
on testcontainers/testcontainers-python
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
testcontainers-4.9.2.tar.gz
- Subject digest:
348c72d369d0bd52b57ab4f07a965ae9562837098c28f0522b969b064b779f10
- Sigstore transparency entry: 177410765
- Sigstore integration time:
- Permalink:
testcontainers/testcontainers-python@a0785d7c63a454184fcfbdb224f189cea8d680aa
- Branch / Tag:
refs/heads/main
- Owner: https://github.com/testcontainers
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
release-please.yml@a0785d7c63a454184fcfbdb224f189cea8d680aa
- Trigger Event:
push
- Statement type:
File details
Details for the file testcontainers-4.9.2-py3-none-any.whl
.
File metadata
- Download URL: testcontainers-4.9.2-py3-none-any.whl
- Upload date:
- Size: 105.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36bd2b58d91f2fc7ac4f4a73c6ec00e5e60c259c10f208dbfe3161029889be92 |
|
MD5 | 2e669a041ed6de5daa66c783bca6293b |
|
BLAKE2b-256 | a2715d4656efa6cf4a8b3bc361170b7df97fdd734aba1c7bfe592058bbab21e4 |
Provenance
The following attestation bundles were made for testcontainers-4.9.2-py3-none-any.whl
:
Publisher:
release-please.yml
on testcontainers/testcontainers-python
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
testcontainers-4.9.2-py3-none-any.whl
- Subject digest:
36bd2b58d91f2fc7ac4f4a73c6ec00e5e60c259c10f208dbfe3161029889be92
- Sigstore transparency entry: 177410767
- Sigstore integration time:
- Permalink:
testcontainers/testcontainers-python@a0785d7c63a454184fcfbdb224f189cea8d680aa
- Branch / Tag:
refs/heads/main
- Owner: https://github.com/testcontainers
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
release-please.yml@a0785d7c63a454184fcfbdb224f189cea8d680aa
- Trigger Event:
push
- Statement type: