From 29c5210e1b4f8c89a0529b7f46f680aab27fef8d Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Sat, 26 Jan 2019 20:03:04 +1100 Subject: [PATCH] fix unit test --- gensim/test/test_fasttext.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gensim/test/test_fasttext.py b/gensim/test/test_fasttext.py index 5437a9b3c8..25b7bf3615 100644 --- a/gensim/test/test_fasttext.py +++ b/gensim/test/test_fasttext.py @@ -695,7 +695,10 @@ def test_online_learning_after_save_fromfile(self): epochs=model_neg.epochs) self.assertEqual(len(model_neg.wv.vocab), 14) - def online_sanity(self, model): + def online_sanity(self, model, epochs=None): + if epochs is None: + epochs = model.epochs + terro, others = [], [] for l in list_corpus: if 'terrorism' in l: @@ -730,9 +733,9 @@ def test_sg_neg_online(self): @unittest.skipIf(IS_WIN32, "avoid memory error with Appveyor x32") def test_cbow_hs_online(self): model = FT_gensim( - sg=0, cbow_mean=1, alpha=0.05, window=2, hs=1, negative=0, min_count=3, iter=1, seed=42, workers=1 + sg=0, cbow_mean=1, alpha=0.05, window=2, hs=1, negative=0, min_count=3, seed=42, workers=1 ) - self.online_sanity(model) + self.online_sanity(model, epochs=1) @unittest.skipIf(IS_WIN32, "avoid memory error with Appveyor x32") def test_cbow_neg_online(self):