diff --git a/src/tests/unit_tests/test_flair_entities_use_case.py b/src/tests/unit_tests/test_flair_entities_use_case.py index 829dbbe..fce32e6 100644 --- a/src/tests/unit_tests/test_flair_entities_use_case.py +++ b/src/tests/unit_tests/test_flair_entities_use_case.py @@ -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" diff --git a/src/tests/unit_tests/test_gliner_entities_use_case.py b/src/tests/unit_tests/test_gliner_entities_use_case.py index df5e6f3..d0a9804 100644 --- a/src/tests/unit_tests/test_gliner_entities_use_case.py +++ b/src/tests/unit_tests/test_gliner_entities_use_case.py @@ -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"}] diff --git a/src/tests/unit_tests/test_named_entities_from_pdf_use_case.py b/src/tests/unit_tests/test_named_entities_from_pdf_use_case.py index c81c36e..0b44631 100644 --- a/src/tests/unit_tests/test_named_entities_from_pdf_use_case.py +++ b/src/tests/unit_tests/test_named_entities_from_pdf_use_case.py @@ -1,3 +1,5 @@ +import pytest +from os import getenv from pathlib import Path from unittest import TestCase from domain.BoundingBox import BoundingBox @@ -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): diff --git a/src/tests/unit_tests/test_named_entities_from_text_use_case.py b/src/tests/unit_tests/test_named_entities_from_text_use_case.py index fb5d8ff..c9d4fec 100644 --- a/src/tests/unit_tests/test_named_entities_from_text_use_case.py +++ b/src/tests/unit_tests/test_named_entities_from_text_use_case.py @@ -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"