Skip to content

Commit

Permalink
Use check_output($args) instead of run_expect([0], $args)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcermak committed Aug 16, 2024
1 parent 70de2e0 commit 4d8ff25
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions tests/test_container_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_auto_container_fixture(auto_container: ContainerData):
"container", [BUSYBOX_WITH_ENTRYPOINT], indirect=["container"]
)
def test_custom_entry_point(container: ContainerData):
container.connection.run_expect([0], "true")
container.connection.check_output("true")


@pytest.mark.parametrize(
Expand All @@ -195,7 +195,7 @@ def test_default_entry_point(container: ContainerData):
@pytest.mark.parametrize("container", [CONTAINER_THAT_STOPS], indirect=True)
def test_container_that_stops(container: ContainerData) -> None:
# it should just be alive
container.connection.run_expect([0], "true")
container.connection.check_output("true")


def test_container_size(
Expand Down Expand Up @@ -240,10 +240,9 @@ def test_multistage_build_target(
extra_build_args=get_extra_build_args(pytestconfig),
)
assert (
LOCALHOST.run_expect(
[0],
LOCALHOST.check_output(
f"{container_runtime.runner_binary} run --rm {first_target}",
).stdout.strip()
).strip()
== "foobar"
)

Expand All @@ -257,10 +256,9 @@ def test_multistage_build_target(

assert first_target != second_target
assert (
LOCALHOST.run_expect(
[0],
LOCALHOST.check_output(
f"{container_runtime.runner_binary} run --rm {second_target} /bin/test.sh",
).stdout.strip()
).strip()
== "foobar"
)

Expand All @@ -270,9 +268,8 @@ def test_multistage_build_target(
):
assert (
distro
in LOCALHOST.run_expect(
[0],
in LOCALHOST.check_output(
f"{container_runtime.runner_binary} run --rm --entrypoint= {target} "
"cat /etc/os-release",
).stdout.strip()
).strip()
)

0 comments on commit 4d8ff25

Please sign in to comment.