- Updates pytest-asyncio to 0.24.0.
Using
'loop_scope="session"
. - Dependency updates.
- Development scripts moved from the Poetry scripts to Makefile. Unnecessary development scripts are no longer packaged as part of the library.
- Dependency updates.
- Extended
pylint
config and addedpydocstringformatter
linter.
- (#306)
Bump
[testcontainers-python](https://github.com/testcontainers/testcontainers-python)
to4.4.1
.
- (#305)
Adds
<CONTAINER-NAME>_TESTCONTAINER_DISABLE_LOGGING
environment variable to selectively disable logging capture and forwarding for specific containers. The use case is that some containers, like Moto, output logs that are not immediately useful for debugging. Example usage:MOTO_TESTCONTAINER_DISABLE_LOGGING=1
.
- Bump pytest-asyncio to 0.21.2 to resolve the compatibility issue with pytest 8.2.0.
- (#242) Drop Python 3.8 support.
- (#242)
Update testcontainers-python to
4.0.0
.
- (#180)
clients.SNSSQSTestClient
:SNSSQSTestClient.receive
now returns message attributes. The returned message is now wrapped in aSQSMessage
dataclass, containing thepayload
andmessage_attributes
fields. It's a small breaking change for clients that use thereceive
method, because the message's payload is now wrapped in thepayload
attribute.
- (#179)
WireMockContainer
: fixedmapping_stubs
andmapping_files
argument precedence over environment variables.
-
New documentation available at https://filipsnastins.github.io/tomodachi-testcontainers/
-
WireMockContainer
: addswiremock_container
pytest fixture. -
WireMockContainer
: addsreset_wiremock_container_on_teardown
pytest fixture that deletes all WireMock stub mappings after each test. -
edge_port
in all Testcontainers now defaults toNone
. When it'sNone
, the container will be started with a random port generated bytomodachi_testcontainers.utils.get_available_port()
. -
tomodachi_testcontainers.pytest
module removed, and the code moved one level up:tomodachi_testcontainers.fixtures
tomodachi_testcontainers.assertions
tomodachi_testcontainers.async_probes
-
Removed the leading underscore from
restart_localstack_container_on_teardown
andreset_moto_container_on_teardown
pytest fixture names. -
Fixtures
moto_snssqs_tc
andlocalstack_snssqs_tc
are now session-scoped (@pytest.fixture(scope="session")
). -
Fixture
testcontainers_docker_image
renamed totestcontainer_image
. -
Renamed environment variables:
Old name New name TOMODACHI_TESTCONTAINER_DOCKER_NETWORK
TESTCONTAINER_DOCKER_NETWORK
TOMODACHI_TESTCONTAINER_DOCKERFILE_PATH
TESTCONTAINER_DOCKERFILE_PATH
TOMODACHI_TESTCONTAINER_DOCKER_BUILD_CONTEXT
TESTCONTAINER_DOCKER_BUILD_CONTEXT
TOMODACHI_TESTCONTAINER_DOCKER_BUILD_TARGET
TESTCONTAINER_DOCKER_BUILD_TARGET
TOMODACHI_TESTCONTAINER_IMAGE_ID
TESTCONTAINER_IMAGE_ID
- (#169)
clients.SNSSQSTestClient
: newsend
method for sending messages to SQS queues.
- (#169)
clients.SNSSQSTestClient
: removed redundantfifo
argument fromcreate_queue
,create_topic
, andsubscribe_to
method; relying on thequeue_name
andtopic_name
to end with.fifo
suffix instead.
- (#156)
The
EphemeralDockerImage
andtestcontainers_docker_image
fixture will raise the original error message if the Docker build with BuiltKit fails. Previously, the original error was hidden.
- Enable parallel test execution with
pytest-xdist
- Fixture
testcontainers_docker_image
now returns animage_id
as astr
instead ofdocker.models.images.Image
instance.
- Support Python 3.12
DynamoDBAdminContainer
: fix AWS region configuration.
TomodachiContainer
- added support for exporting code coverage.TomodachiContainer
- added example of how to attach a remote debugger to the container.
README
: documented Testcontainer debugging tips.README
: documented how to export test coverage fromTomodachiContainer
.
DockerContainer
- logs forwarded from the Testcontainers will exclude timestamps to make it easier to read the logs - log lines will be shorter.DockerContainer
- removedtestconatiners-
prefix from the container name to make it easier to read the logs - log lines will be shorter.
- Added Minio container -
MinioContainer
- Added DynamoDB Admin container -
DynamoDBAdminContainer
- Set
AWS_DEFAULT_REGION
,AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
environment variables on LocalStack container.
LocalStackContainer
- updated base image tolocalstack/localstack:3
PostgreSQLContainer
- updated base image topostgres:16
DockerContainer
: remove container if startup failed instead of leaving it in stopped state.MySQLContainer
: addcryptography
as an extra dependency. Required forpymysql
.
- Fixed a typo in
pyproject
extra dependencies -pip install tomodachi-testcontainers[mysql]
-
DockerContainer
: logs from the container are now prefixed with the container name. This makes it easier to distinguish logs from multiple containers, especially when using multiple containers of the same type. -
WireMockContainer
: added example of configuring WireMock mappings with python-wiremock. Install python-wiremock as an extra dependency with:pip install tomodachi-testcontainers[wiremock]
DockerContainer
: forward container logs to the Python logger only when theDockerContainer
used as a context manager. Otherwise, the logger fails in theDockerContainer.__del__
method, because the logger instance is already closed.
import tomodachi_testcontainers.pytest
was failing withImportError
becauseMySQL
andPostgreSQL
fixtures were not handled as optional imports.
-
(#90)
DockerContainer
: added abstract methodlog_message_on_container_start
which returns a string that is logged when the container starts. It's useful for providing an information message of how to use the test container. For example, in case ofMotoContainer
, it outputs a link to the Moto Dashboard. -
(#90)
clients.snssqs
: added cache for storing topic/queue ARNs and URLs to reduce amount of API calls to AWS -
(#90)
clients.snssqs
: added new methods for fetching topic/queue attributes:get_topic_arn
get_topic_attributes
get_queue_arn
get_queue_url
get_queue_attributes
-
(#90)
clients.snssqs
: addedpurge_queue
method -
(#92) Added abstract
DatabaseContainer
andWebContainer
-
(#92) Added
MySQLContainer
-
Install with:
# DatabaseContainer and SQLAlchemy pip install tomodachi-testcontainers[db] # MySQLContainer, SQLAlchemy and pymysql pip install tomodachi-testcontainers[mysql]
-
-
(#94) Added
PostgreSQLContainer
-
Install with:
# DatabaseContainer and SQLAlchemy pip install tomodachi-testcontainers[db] # PostgreSQLContainer, SQLAlchemy and psycopg2 pip install tomodachi-testcontainers[postgres]
-