Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
testinfra docker jenkins example
import docker
import pytest
import testinfra
@pytest.fixture(scope="module", name="host")
def docker_host():
client = docker.from_env()
container ="jenkins", detach=True)
yield testinfra.get_host("docker://{}".format(
def test_current_user_is_jenkins(host):
assert host.user().name == "jenkins"
assert host.user().group == "jenkins"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.