Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix: skip sentence-splitter tests when HuggingFace Hub is unreachable (#2689)

LearningCircuit6eda7a33da1b
diff --git a/tests/embeddings/test_text_splitter_registry.py b/tests/embeddings/test_text_splitter_registry.py
index 04c6bb6975..164d5cfc05 100644
--- a/tests/embeddings/test_text_splitter_registry.py
+++ b/tests/embeddings/test_text_splitter_registry.py
@@ -11,6 +11,27 @@ import pytest
from unittest.mock import patch, MagicMock
+def _huggingface_hub_reachable() -> bool:
+ """Return True when HuggingFace Hub is reachable (best-effort check)."""
+ try:
+ import httpx
+
+ resp = httpx.head(
+ "https://huggingface.co/sentence-transformers/all-mpnet-base-v2/resolve/main/config.json",
+ timeout=5,
+ follow_redirects=True,
+ )
+ return resp.status_code < 400
+ except Exception:
+ return False
+
+
+_skip_no_hf = pytest.mark.skipif(
+ not _huggingface_hub_reachable(),
+ reason="HuggingFace Hub is unreachable (network or auth)",
+)
+
+
class TestValidSplitterTypes:
"""Tests for VALID_SPLITTER_TYPES constant."""
@@ -139,6 +160,7 @@ class TestGetTextSplitterToken:
class TestGetTextSplitterSentence:
"""Tests for get_text_splitter with sentence type."""
+ @_skip_no_hf
def test_get_text_splitter_sentence(self):
"""Test getting sentence splitter."""
from local_deep_research.embeddings.splitters.text_splitter_registry import (
@@ -153,6 +175,7 @@ class TestGetTextSplitterSentence:
assert isinstance(splitter, SentenceTransformersTokenTextSplitter)
+ @_skip_no_hf
def test_get_text_splitter_sentence_custom_params(self):
"""Test sentence splitter with custom parameters."""
from local_deep_research.embeddings.splitters.text_splitter_registry import (