check if libcublas is available before running extended tests

pull/10242/head
olgavrou 10 months ago
parent 248db75cd6
commit 7185fdc990

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

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

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

Loading…
Cancel
Save