use importorskip

This commit is contained in:
nicholasmhughes 2024-03-31 11:05:03 -04:00 committed by Pedro Algarvio
parent ed345d06e7
commit 025b3f073e

View file

@ -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