Skip to content

Commit

Permalink
Add skip to tests requires ner models locally
Browse files Browse the repository at this point in the history
  • Loading branch information
ali6parmak committed Jan 15, 2025
1 parent aeeedee commit a153a74
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/tests/unit_tests/test_flair_entities_use_case.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import pytest
from os import getenv
from unittest import TestCase

from domain.NamedEntity import NamedEntity
from domain.NamedEntityType import NamedEntityType
from use_cases.GetFlairEntitiesUseCase import GetFlairEntitiesUseCase


@pytest.mark.skipif(getenv("CI") == "true", reason="Skip in CI environment as models are not downloaded locally")
class TestFlairEntitiesUseCase(TestCase):
def test_entity_extraction(self):
text = "Maria Rodriguez visited the Louvre Museum in Paris, France, on Wednesday, July 12, 2023"
Expand Down
4 changes: 3 additions & 1 deletion src/tests/unit_tests/test_gliner_entities_use_case.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import pytest
from os import getenv
from unittest import TestCase

from domain.NamedEntity import NamedEntity
from domain.NamedEntityType import NamedEntityType
from use_cases.GetGLiNEREntitiesUseCase import GetGLiNEREntitiesUseCase


@pytest.mark.skipif(getenv("CI") == "true", reason="Skip in CI environment as models are not downloaded locally")
class TestGLiNEREntitiesUseCase(TestCase):
def test_datetime_normalized(self):
window_entities: list[dict] = [{"start": 0, "end": 0, "text": "12 January 2024"}]
Expand Down
3 changes: 3 additions & 0 deletions src/tests/unit_tests/test_named_entities_from_pdf_use_case.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pytest
from os import getenv
from pathlib import Path
from unittest import TestCase
from domain.BoundingBox import BoundingBox
Expand Down Expand Up @@ -29,6 +31,7 @@ def get_segments(pdf_path: Path) -> list[PDFSegment]:
]


@pytest.mark.skipif(getenv("CI") == "true", reason="Skip in CI environment as models are not downloaded locally")
class TestNamedEntitiesFromPDFUseCase(TestCase):

def test_get_entities(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import pytest
from os import getenv
from unittest import TestCase

from domain.NamedEntity import NamedEntity
from domain.NamedEntityType import NamedEntityType
from use_cases.NamedEntitiesFromTextUseCase import NamedEntitiesFromTextUseCase


@pytest.mark.skipif(getenv("CI") == "true", reason="Skip in CI environment as models are not downloaded locally")
class TestNamedEntityMergerUseCase(TestCase):
def test_get_entities(self):
text = "Maria Rodriguez visited the Louvre Museum in Paris, France, on Wednesday, July 12, 2023"
Expand Down

0 comments on commit a153a74

Please sign in to comment.