mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-03 03:59:42 +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
|
from typing import Iterator, List
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
from . import is_libcublas_available
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module", autouse=True)
|
@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")
|
pytest.skip(reason="Spacy model 'en_core_web_lg' not installed")
|
||||||
yield
|
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.requires("presidio_analyzer", "presidio_anonymizer", "faker")
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
@@ -2,6 +2,7 @@ import os
|
|||||||
from typing import Iterator, List
|
from typing import Iterator, List
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
from . import is_libcublas_available
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module", autouse=True)
|
@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")
|
pytest.skip(reason="Spacy model 'en_core_web_lg' not installed")
|
||||||
yield
|
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.requires("presidio_analyzer", "presidio_anonymizer", "faker")
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
Reference in New Issue
Block a user