Prerequisites

pytest_container works with Python 3.6 and later and requires pytest and pytest-testinfra. Additionally, for python 3.6, you’ll need the dataclasses module.

Tests leveraging pytest_container need to have access to a container runtime. Currently the following ones are supported:

  • podman and buildah (buildah is optional and if missing, podman is leveraged for building container images)

  • docker

The fixtures will default to using podman (and optionally buildah for building or fallback to podman), if they are installed and work, otherwise docker will be used. You can also customize which runtime will be used via the environment variable CONTAINER_RUNTIME [1].