- When integration or end-to-end test needs temporal docker container to fake remote systems, this package will help to create/close/remove the temporal docker container.
- Create docker container by giving image name. The container will be named as 'docontext={name}'
- Close and remove the container when exit.
import pytest
from dockontext import container_generator_from_image, Result, Config
create_container = pytest.fixture(container_generator_from_image)
def test_fixture(create_container):
config = Config(name, "alpine:latest")
container = create_container(config)
result = container.execute("echo hello", timeout: float)
assert result == Result(returncode=0, stdout="hello\n", stderr="")
- Dockerfile
- docker-compose.yml
- container group context
- This package was created with Cookiecutter
- Also was copied and modified from the audreyr/cookiecutter-pypackage project template.