Skip to content

Commit ae81fe6

Browse files
committed
Test speedup
1 parent c18b170 commit ae81fe6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

orangecontrib/text/widgets/tests/test_owkeywords.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from orangecontrib.text import Corpus
1212
from orangecontrib.text.keywords import tfidf_keywords, yake_keywords, \
13-
rake_keywords, embedding_keywords
13+
rake_keywords
1414
from orangecontrib.text.preprocess import *
1515
from orangecontrib.text.widgets.owkeywords import OWKeywords, run, \
1616
AggregationMethods, ScoringMethods
@@ -182,10 +182,14 @@ def test_sort_nans_asc(self):
182182
["System", "Widths", "opinion"])
183183

184184
def test_scoring_methods(self):
185+
# speed-up the test execution
186+
def dummy_embedding(tokens, language, progress_callback=None):
187+
return tfidf_keywords(tokens, progress_callback)
188+
185189
methods = [("TF-IDF", Mock(wraps=tfidf_keywords)),
186190
("YAKE!", Mock(wraps=yake_keywords)),
187191
("Rake", Mock(wraps=rake_keywords)),
188-
("Embedding", Mock(wraps=embedding_keywords))]
192+
("Embedding", Mock(side_effect=dummy_embedding))]
189193
with patch.object(ScoringMethods, "ITEMS", methods) as m:
190194
scores = {"TF-IDF", "YAKE!", "Rake", "Embedding"}
191195
settings = {"selected_scoring_methods": scores}

0 commit comments

Comments
 (0)