Skip to content

Commit 3e1fb03

Browse files
committed
test: skip clone when client is not available
1 parent c11634e commit 3e1fb03

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test/functional/test_download_clone.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
1+
import shutil
2+
13
import pytest
24

35
from install_locked_env.downloaders import download_via_clone
46

57
from .util import get_url_info_env
68

79

10+
has_hg = bool(shutil.which("hg"))
11+
has_git = bool(shutil.which("git"))
12+
skipif = pytest.mark.skipif
13+
14+
815
@pytest.mark.slow
9-
@pytest.mark.parametrize("platform", ["github", "heptapod"])
16+
@pytest.mark.parametrize(
17+
"platform",
18+
[
19+
pytest.param("github", marks=skipif(not has_git, reason="Needs Git")),
20+
pytest.param("heptapod", marks=skipif(not has_hg, reason="Needs Mercurial")),
21+
],
22+
)
1023
def test_download_via_clone(tmp_path, platform):
1124
"""test download via archives"""
1225
url_info = get_url_info_env(platform, "root")

0 commit comments

Comments
 (0)