Features
Containers
See the list of available Testcontainers at tomodachi_testcontainers
.
Find more Testcontainers in the official testcontainers-python library.
See Creating New Testcontainers for adding new Testcontainers.
Pytest fixtures and helpers
Ready-made pytest fixtures make testing your applications simple.
Find the complete list of available fixtures at tomodachi_testcontainers.fixtures
.
-
testcontainer_image
fixture builds a Docker image with a Dockerfile from the current working directory. It allows you to run the latest version of our application as a Docker container for automated testing. -
Launch commonly used Testcontainers with fixtures, e.g.,
localstack_container
,postgres_container
, etc. -
Get fixtures for interacting with Testcontainers, e.g.,
localstack_s3_client
,moto_dynamodb_client
, etc.
Async probes for testing asynchronous systems -
tomodachi_testcontainers.async_probes
.
Inspired by Awaitility and busypie.
Assertion helpers for common test cases like asserting for logs in a Docker container -
tomodachi_testcontainers.assertions
.
Utility functions in tomodachi_testcontainers.utils
for easier working with Testcontainers.
Test clients
Test clients allow you to test different modes of interactions with your applications.
SNSSQSTestClient
helps test Tomodachi applications that communicate through AWS SNS SQS.
Logging
Upon Testcontainers' shutdown, their logs are forwarded to Python's logger, making it possible to see what happened inside the containers. It's useful for debugging failing tests, especially in a deployment pipeline, because containers are immediately deleted when the test run finishes, leaving behind only their logs.
Configuration
Most features are configurable with environment variables, e.g., a path to Dockerfile, Testcontainer image versions, etc. See all configuration options.