tests: idalib: better detect missing idapro package

This commit is contained in:
Willi Ballenthin
2025-12-16 13:51:21 +01:00
parent ef8f6e1bc0
commit ef2ddb08a2

View File

@@ -22,6 +22,11 @@ import capa.features.extractors.ida.idalib
logger = logging.getLogger(__name__)
idalib_present = capa.features.extractors.ida.idalib.has_idalib()
if idalib_present:
try:
import idapro # noqa: F401 [imported but unused]
except ImportError:
idalib_present = False
@pytest.mark.skipif(idalib_present is False, reason="Skip idalib tests if the idalib Python API is not installed")