Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ac2520c

Browse files
committed
skip if swift not installed
1 parent ca73126 commit ac2520c

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

testing/util.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import unicode_literals
22

3+
import distutils
34
import os.path
45
import shutil
56

@@ -68,6 +69,11 @@ def cmd_output_mocked_pre_commit_home(*args, **kwargs):
6869
reason='slowtests=false',
6970
)
7071

72+
skipif_cant_run_swift = pytest.mark.skipif(
73+
distutils.spawn.find_executable('swift') is None,
74+
reason='swift isn\'t installed or can\'t be found'
75+
)
76+
7177
xfailif_windows_no_ruby = pytest.mark.xfail(
7278
os.name == 'nt',
7379
reason='Ruby support not yet implemented on windows.',

tests/repository_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from testing.fixtures import make_repo
3131
from testing.fixtures import modify_manifest
3232
from testing.util import skipif_cant_run_docker
33+
from testing.util import skipif_cant_run_swift
3334
from testing.util import skipif_slowtests_false
3435
from testing.util import xfailif_no_pcre_support
3536
from testing.util import xfailif_windows_no_node
@@ -214,6 +215,7 @@ def test_system_hook_with_spaces(tempdir_factory, store):
214215
)
215216

216217

218+
@skipif_cant_run_swift
217219
@pytest.mark.integration
218220
def test_swift_hook(tempdir_factory, store):
219221
_test_hook_repo(

0 commit comments

Comments
 (0)