Skip to content

Commit

Permalink
Merge pull request #299 from felddy/improvement/pytest-8
Browse files Browse the repository at this point in the history
Remove `lazy-fixture-pytest` library for upgrade to `pytest v8.0.0`
  • Loading branch information
felddy authored Feb 2, 2024
2 parents 389d546 + 73af4a1 commit 6b67b80
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ def package_vars(version_file):
"coveralls == 3.3.1",
"docker == 7.0.0",
"pre-commit == 3.6.0",
"pytest == 7.4.4",
"pytest == 8.0.0",
"pytest-cov == 4.1.0",
"pytest-lazy-fixture == 0.6.3",
]
},
)
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 6b67b80

Please sign in to comment.