Skip to content

Commit

Permalink
fixed loading of spacy model for test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tholzheim committed May 17, 2024
1 parent 0f4df86 commit 1a270db
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
- name: install
run: |
scripts/install
python -m spacy download en_core_web_sm
# pip install sphinx
# pip install sphinx_rtd_theme
# scripts/doc
Expand Down
1 change: 0 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ before_script:
- source venv/bin/activate
- pip install .[test]
- python scripts/getData.py
- python -m spacy download en_core_web_sm
test:
script:
- tox -e py
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dependencies = [
"spacy"
]

requires-python = ">=3.9"
requires-python = ">=3.10"
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
Expand Down
11 changes: 11 additions & 0 deletions tests/test_entity_fishing.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
import unittest

import spacy
from spacy.cli import download

from ceurws.services.entity_fishing import ENTITY_FISHING_PIPELINE
from tests.basetest import Basetest, requires_entity_fishing_endpoint


class TestEntityFishing(Basetest):

def setUp(self, debug=False, profile=True):
super(TestEntityFishing, self).setUp(debug=debug, profile=profile)
try:
nlp_lg = spacy.load("en_core_web_sm")
except (ModuleNotFoundError, IOError):
download(model="en_core_web_sm")
nlp_lg = spacy.load("en_core_web_sm")
self.nlp = nlp_lg

@requires_entity_fishing_endpoint
def test_entity_fishing_spacy_pipeline(self):
"""
Expand Down

0 comments on commit 1a270db

Please sign in to comment.