From d8b1a3e70d1b397d1a2a9ff8e53cc4d334617483 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Wed, 5 Jul 2023 09:51:24 -0600 Subject: [PATCH] Reverted reviewers suggestion, caused issues with missing variables in tests --- tests/pytests/unit/utils/test_nacl.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 {