Skip to content

Commit 6cf9f82

Browse files
authored
test: skip FastEmbed tests when not in live mode (#1462)
Skip FastEmbed embedding tests by default to prevent CI failures from external HuggingFace infrastructure issues.
1 parent ce7b866 commit 6cf9f82

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_embeddings_fastembed.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,16 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
import os
17+
1618
import pytest
1719

1820
from nemoguardrails.embeddings.providers.fastembed import FastEmbedEmbeddingModel
1921

22+
LIVE_TEST_MODE = os.environ.get("LIVE_TEST")
23+
2024

25+
@pytest.mark.skipif(not LIVE_TEST_MODE, reason="Not in live mode.")
2126
def test_sync_embeddings():
2227
model = FastEmbedEmbeddingModel("all-MiniLM-L6-v2")
2328

@@ -26,13 +31,15 @@ def test_sync_embeddings():
2631
assert len(result[0]) == 384
2732

2833

34+
@pytest.mark.skipif(not LIVE_TEST_MODE, reason="Not in live mode.")
2935
def test_additional_params_with_fastembed():
3036
model = FastEmbedEmbeddingModel("all-MiniLM-L6-v2", max_length=512, lazy_load=True)
3137
result = model.encode(["test"])
3238

3339
assert len(result[0]) == 384
3440

3541

42+
@pytest.mark.skipif(not LIVE_TEST_MODE, reason="Not in live mode.")
3643
@pytest.mark.asyncio
3744
async def test_async_embeddings():
3845
model = FastEmbedEmbeddingModel("all-MiniLM-L6-v2")

0 commit comments

Comments
 (0)