A set of tools for creating declarative docker py.test integration fixtures.
Project description
pytest-docker-tools
This package contains some opinionated helpers for Dockerized integration
testing drive by py.test.
You can define your fixtures in your conftest.py or in the test module
where you are using them.
A simple example of a container built from an image with a volume attached:
from pytest_docker_tools.factories import *
container(
'my_microservice',
image('my_microservice_image', path='.'),
volumes={
volume('my_microservice_data'): {'bind': '/var/tmp'},
}
)
Wherever possible the arguments to container_fixture mirror the arguments to the python docker libraries run() API.
You can create containers that depend on other containers:
from pytest_docker_tools.factories import *
container(
'my_database',
image('my_database_image', path='db'),
volumes={
volume('my_microservice_data'): {'bind': '/var/tmp'},
}
)
container(
'my_microservice',
image('my_microservice_image', path='microservice'),
environment={
'DATABASE_IP': lambda my_database: my_database['ip'],
}
)
Whenever you create a test that uses the my_microservice container it will also start a database container.
Project details
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 Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest_docker_tools-0.0.2.tar.gz.
File metadata
- Download URL: pytest_docker_tools-0.0.2.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e94e1eaaacf71eaa1419e6fd58bad4cae0a292315f3d79ab4f738444ac0d1da
|
|
| MD5 |
09b5498f007726767af8aea8d63b9e89
|
|
| BLAKE2b-256 |
20845e2e1c776fa13025145efa74c444bd05c3b4661715debd463eb6ab5cb9e3
|
File details
Details for the file pytest_docker_tools-0.0.2-py3-none-any.whl.
File metadata
- Download URL: pytest_docker_tools-0.0.2-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbbcedc816c0e0ccd3bf71e45d7ee1b3b1ed87922b6662c15c5d3eb6700fae65
|
|
| MD5 |
1b234d01fc0620c9eff76f8f009548b5
|
|
| BLAKE2b-256 |
d3ae734f02703fb2b4d4d1ad5046664e52329235cac1601424e41964745bcee9
|
File details
Details for the file pytest_docker_tools-0.0.2-py2.py3-none-any.whl.
File metadata
- Download URL: pytest_docker_tools-0.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75df6fdcd99f6a368ce7cc7792bb71d74a6b8ba99cd002351c1fd58f7157b596
|
|
| MD5 |
ff69043cc0b4182876f56d7cbc9797aa
|
|
| BLAKE2b-256 |
b9cf47b07e2110294bec4443c3c0b7bb2e61c7eaf9226632bf88ecc49e9a908c
|
Provenance
The following attestation bundles were made for pytest_docker_tools-0.0.2-py2.py3-none-any.whl:
Publisher:
ci.yml on Jc2k/pytest-docker-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_docker_tools-0.0.2-py2.py3-none-any.whl -
Subject digest:
75df6fdcd99f6a368ce7cc7792bb71d74a6b8ba99cd002351c1fd58f7157b596 - Sigstore transparency entry: 182237104
- Sigstore integration time:
-
Permalink:
Jc2k/pytest-docker-tools@46363d27f84d0bc3c8a968b041c0d5ce729bfdea -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Jc2k
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@46363d27f84d0bc3c8a968b041c0d5ce729bfdea -
Trigger Event:
push
-
Statement type: