Skip to content

Commit

Permalink
test: minor fix to image_type fixture
Browse files Browse the repository at this point in the history
Small fix to the `image_type` fixture by deduplicating the call to `build_images`
  • Loading branch information
kingsleyzissou authored and achilleas-k committed May 3, 2024
1 parent d8e1864 commit 648417e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ def image_type_fixture(shared_tmpdir, build_container, request, force_aws_upload
"""
container_ref, images, target_arch, local = parse_request_params(request)

if not local:
with build_images(shared_tmpdir, build_container, request, force_aws_upload) as build_results:
yield build_results[0]
else:
if local:
cont_tag = "localhost/cont-base-" + "".join(random.choices(string.digits, k=12))

# we are not cross-building local images (for now)
Expand All @@ -95,8 +92,8 @@ def image_type_fixture(shared_tmpdir, build_container, request, force_aws_upload
f"containers-storage:[overlay@/var/lib/containers/storage+/run/containers/storage]{cont_tag}"
])

with build_images(shared_tmpdir, build_container, request, force_aws_upload) as build_results:
yield build_results[0]
with build_images(shared_tmpdir, build_container, request, force_aws_upload) as build_results:
yield build_results[0]


@pytest.fixture(name="images", scope="session")
Expand Down

0 comments on commit 648417e

Please sign in to comment.