diff --git a/tests/pytests/unit/utils/test_nacl.py b/tests/pytests/unit/utils/test_nacl.py index 8e48a8a13163..c23f6bc08468 100644 --- a/tests/pytests/unit/utils/test_nacl.py +++ b/tests/pytests/unit/utils/test_nacl.py @@ -9,7 +9,17 @@ import salt.utils.files from tests.support.mock import patch -pytest.importorskip("libnacl") +try: + import salt.utils.nacl as nacl + + HAS_PYNACL = nacl.check_requirements +except (ImportError, OSError, AttributeError): + HAS_PYNACL = False + + +@pytest.mark.skipif( + not HAS_PYNACL, reason="skipping test_nacl, reason=PyNaCl is unavailable" +) @pytest.fixture def configure_loader_modules(): return {