mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-31 10:23:18 +00:00
check if libcublas is available before running extended tests
This commit is contained in:
@@ -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(
|
||||
|
Reference in New Issue
Block a user