From 340d6f05ae6c8e202474557844e566fe1d9afa46 Mon Sep 17 00:00:00 2001 From: Kenneth Enevoldsen Date: Wed, 18 Oct 2023 10:26:38 +0200 Subject: [PATCH] fix: avoid downloading model for tests --- tests/test_relationextraction_component.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_relationextraction_component.py b/tests/test_relationextraction_component.py index 1ecb3bd..f92c285 100644 --- a/tests/test_relationextraction_component.py +++ b/tests/test_relationextraction_component.py @@ -1,8 +1,11 @@ +import pytest + from conspiracies.relationextraction import SpacyRelationExtractor # noqa F401 from .utils import nlp_da # noqa F401 +@pytest.mark.skip(reason="Avoid downloading the model on GitHub actions") def test_relationextraction_component_pipe(nlp_da): # noqa F811 test_sents = [ "Pernille Blume vinder delt EM-sølv i Ungarn.", @@ -22,6 +25,7 @@ def test_relationextraction_component_pipe(nlp_da): # noqa F811 print(d.text, "\n", d._.relation_triplets) +@pytest.mark.skip(reason="Avoid downloading the model on GitHub actions") def test_relation_extraction_component_single(nlp_da): # noqa F811 nlp_da.add_pipe("relation_extractor", config={"confidence_threshold": 1.8}) doc = nlp_da("Obama is the former president of the United States.") @@ -48,12 +52,14 @@ def test_relation_extraction_multi_sentence(nlp_da): # noqa F811 ] +@pytest.mark.skip(reason="Avoid downloading the model on GitHub actions") def test_relation_extraction_empty_string(nlp_da): # noqa F811 nlp_da.add_pipe("relation_extractor") doc = nlp_da("") assert doc._.relation_triplets == [] +@pytest.mark.skip(reason="Avoid downloading the model on GitHub actions") def test_relation_extraction_no_extracted_relation(nlp_da): # noqa F811 nlp_da.add_pipe("relation_extractor") doc = nlp_da("Ingen relation")