Skip to content

Commit

Permalink
Update test/integration/docker/image.py
Browse files Browse the repository at this point in the history
Co-authored-by: Christoph Kuhnke <[email protected]>
  • Loading branch information
tkilias and ckunki authored Jan 29, 2024
1 parent 7ccefc2 commit bb4f130
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/integration/docker/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ def __init__(self, reason, build_log: List[Dict[str, Any]]):


def image(request, name: str, print_log=False, **kwargs) -> Image:
"""
Create a Docker image.
The function supports a pair of pytest cli options with a suffix derived from parameter ``name``:
Option `--docker-image-(suffix)` specifies the name of an existing image to be used
instead of creating a new one.
Option `--keep-docker-image-(suffix)` skips removing the image after test execution.
"""
base_command_line = name.replace("_", "-")
image_tag = request.config.getoption(f"--docker-image-{base_command_line}")
keep_image = request.config.getoption(f"--keep-docker-image-{base_command_line}")
Expand Down

0 comments on commit bb4f130

Please sign in to comment.