Skip to content

Commit 6016d97

Browse files
author
Zach Moody
authored
Merge pull request #350 from digitalocean/fix-docker-check
Move dependency binary checks
2 parents 7e16662 + bca0372 commit 6016d97

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/integration/conftest.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ def git_toplevel():
5252
str: The path of the top level directory of the current git repo.
5353
5454
"""
55+
try:
56+
subp.check_call(["which", "git"])
57+
except subp.CalledProcessError:
58+
pytest.skip(msg="git executable was not found on the host")
5559
return (
5660
subp.check_output(["git", "rev-parse", "--show-toplevel"])
5761
.decode("utf-8")
@@ -73,6 +77,10 @@ def netbox_docker_repo_dirpaths(pytestconfig, git_toplevel):
7377
]
7478
}
7579
"""
80+
try:
81+
subp.check_call(["which", "docker"])
82+
except subp.CalledProcessError:
83+
pytest.skip(msg="docker executable was not found on the host")
7684
netbox_versions_by_repo_dirpaths = {}
7785
for netbox_version in pytestconfig.option.netbox_versions:
7886
repo_version_tag = get_netbox_docker_version_tag(netbox_version=netbox_version)
@@ -196,11 +204,6 @@ def docker_compose_file(pytestconfig, netbox_docker_repo_dirpaths):
196204
clean_netbox_docker_tmpfiles()
197205
clean_docker_objects()
198206

199-
try:
200-
subp.check_call(["which", "docker"])
201-
except subp.CalledProcessError:
202-
pytest.skip(msg="docker executable was not found on the host")
203-
204207
compose_files = []
205208

206209
for (

0 commit comments

Comments
 (0)