Skip to content

Commit

Permalink
Refactor container test fixture usage
Browse files Browse the repository at this point in the history
  • Loading branch information
felddy committed Feb 2, 2024
1 parent 9f7960f commit 73af4a1
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions tests/container_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,30 @@
VERSION_FILE = "src/_version.py"


@pytest.mark.parametrize(
"container",
[
pytest.lazy_fixture("gen_test_config_container"),
],
)
def test_gen_config(container):
def test_gen_config(gen_test_config_container):
"""Test that the test configuration generator has completed."""
# Wait until the container has exited or timeout.

for _ in range(10):
container.reload()
if container.status == "exited":
gen_test_config_container.reload()
if gen_test_config_container.status == "exited":
break
time.sleep(1)
assert container.status in ("exited")
assert gen_test_config_container.status in ("exited")


@pytest.mark.parametrize(
"container",
[
pytest.lazy_fixture("main_container"),
pytest.lazy_fixture("version_container"),
"main_container",
"version_container",
],
)
def test_container_running(container):
def test_container_running(container, request):
"""Test that the container has started."""
# Lazy fixture evaluation
container = request.getfixturevalue(container)

# Wait until the container is running or timeout.
for _ in range(10):
container.reload()
Expand Down

0 comments on commit 73af4a1

Please sign in to comment.