From 025b3f073e3961f5f43ca3fb69cd6ef35668304f Mon Sep 17 00:00:00 2001 From: nicholasmhughes Date: Sun, 31 Mar 2024 11:05:03 -0400 Subject: [PATCH] use importorskip --- tests/pytests/functional/utils/test_x509.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/tests/pytests/functional/utils/test_x509.py b/tests/pytests/functional/utils/test_x509.py index 87b1e53c491..43d7832b494 100644 --- a/tests/pytests/functional/utils/test_x509.py +++ b/tests/pytests/functional/utils/test_x509.py @@ -4,16 +4,7 @@ import pytest import salt.utils.x509 as x509 -try: - import cryptography.x509 as cx509 - - HAS_LIBS = True -except ImportError: - HAS_LIBS = False - -pytestmark = [ - pytest.mark.skipif(HAS_LIBS is False, reason="Needs cryptography library") -] +cx509 = pytest.importorskip("cryptography.x509") @pytest.fixture