Skip to content

Commit

Permalink
fix extra tests
Browse files Browse the repository at this point in the history
  • Loading branch information
epinzur committed Feb 5, 2025
1 parent 017cf4e commit 5313962
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import pytest
from langchain_core.documents import Document
from langchain_graph_retriever.transformers.gliner import GLiNERTransformer


@pytest.mark.extra
def test_transform_documents(animal_docs: list[Document]):
from gliner import GLiNER # type: ignore
from langchain_graph_retriever.transformers.gliner import GLiNERTransformer

class FakeGLiNER(GLiNER):
def __init__(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import pytest
from langchain_core.documents import Document
from langchain_graph_retriever.transformers.html_hyperlink import (
HtmlHyperlinkTransformer,
)

test_html = """
<!DOCTYPE html>
Expand All @@ -28,6 +25,10 @@

@pytest.mark.extra
def test_transform_documents():
from langchain_graph_retriever.transformers.html_hyperlink import (
HtmlHyperlinkTransformer,
)

doc = Document(
id="animal_html",
page_content=test_html,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import pytest
from langchain_core.documents import Document
from langchain_graph_retriever.transformers.keybert import KeyBERTTransformer


@pytest.mark.extra
def test_transform_documents(animal_docs: list[Document]):
from keybert import KeyBERT # type: ignore
from langchain_graph_retriever.transformers.keybert import KeyBERTTransformer

class FakeKeyBERT(KeyBERT):
def __init__(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import pytest
from langchain_core.documents import Document
from langchain_graph_retriever.transformers.spacy import SpacyNERTransformer


@pytest.mark.extra
def test_transform_documents(animal_docs: list[Document]):
from langchain_graph_retriever.transformers.spacy import SpacyNERTransformer
from spacy.language import Language
from spacy.tokens import Doc, Span
from spacy.vocab import Vocab
Expand Down

0 comments on commit 5313962

Please sign in to comment.