check if libcublas is available before running extended tests

This commit is contained in:
olgavrou
2023-09-11 13:26:41 -04:00
parent 248db75cd6
commit 7185fdc990
3 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
import ctypes
def is_libcublas_available():
try:
ctypes.CDLL("libcublas.so")
return True
except OSError:
return False

View File

@@ -1,6 +1,7 @@
from typing import Iterator, List
import pytest
from . import is_libcublas_available
@pytest.fixture(scope="module", autouse=True)
@@ -11,6 +12,13 @@ def check_spacy_model() -> Iterator[None]:
pytest.skip(reason="Spacy model 'en_core_web_lg' not installed")
yield
@pytest.fixture(scope="module", autouse=True)
def check_libcublas() -> Iterator[None]:
if not is_libcublas_available():
pytest.skip(reason="libcublas.so is not available")
yield
@pytest.mark.requires("presidio_analyzer", "presidio_anonymizer", "faker")
@pytest.mark.parametrize(

View File

@@ -2,6 +2,7 @@ import os
from typing import Iterator, List
import pytest
from . import is_libcublas_available
@pytest.fixture(scope="module", autouse=True)
@@ -12,6 +13,12 @@ def check_spacy_model() -> Iterator[None]:
pytest.skip(reason="Spacy model 'en_core_web_lg' not installed")
yield
@pytest.fixture(scope="module", autouse=True)
def check_libcublas() -> Iterator[None]:
if not is_libcublas_available():
pytest.skip(reason="libcublas.so is not available")
yield
@pytest.mark.requires("presidio_analyzer", "presidio_anonymizer", "faker")
@pytest.mark.parametrize(