Python port for testcontainers-java that allows using docker containers for functional and integration testing. Testcontainers-python provides capabilities to spin up docker containers (such as a database, Selenium web browser, or any other container) for testing.
Currently available features:
- Selenium Grid containers
- Selenium Standalone containers
- MySql Db container
- MariaDb container
- Neo4j container
- OracleDb container
- PostgreSQL Db container
- Microsoft SQL Server container
- Generic docker containers
- LocalStack
The testcontainers package is available from PyPI, and it can be installed using pip. Depending on which containers are needed, you can specify additional dependencies as extras:
# Install without extras
pip install testcontainers
# Install with one or more extras
pip install testcontainers[mysql]
pip install testcontainers[mysql,oracle]