Skip to content

Commit 38fb76c

Browse files
garethgreenawaydwoz
authored andcommitted
Adding a check to skip mac_assistive tests if the osa_script is unable to be installed.
1 parent d18969d commit 38fb76c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/pytests/functional/modules/test_mac_assistive.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
import pytest
66

7+
from salt.exceptions import CommandExecutionError
8+
79
pytestmark = [
810
pytest.mark.destructive_test,
911
pytest.mark.skip_if_not_root,
@@ -23,7 +25,11 @@ def osa_script():
2325

2426
@pytest.fixture(scope="function", autouse=True)
2527
def _setup_teardown_vars(assistive, osa_script):
26-
assistive.install(osa_script, True)
28+
try:
29+
ret = assistive.install(osa_script, True)
30+
except CommandExecutionError as exc:
31+
pytest.skip(f"Unable to install {osa_script} - {str(exc.value)}")
32+
2733
try:
2834
yield
2935
finally:

0 commit comments

Comments
 (0)