diff --git a/gensim/test/test_sklearn_api.py b/gensim/test/test_sklearn_api.py index 3793c79948..5e0511aa5c 100644 --- a/gensim/test/test_sklearn_api.py +++ b/gensim/test/test_sklearn_api.py @@ -973,13 +973,13 @@ def testTransform(self): def testSetGetParams(self): # updating only one param - self.model.set_params(normalize=False) + self.model.set_params(smartirs='nnn') model_params = self.model.get_params() - self.assertEqual(model_params["normalize"], False) + self.assertEqual(model_params["smartirs"], 'nnn') # verify that the attributes values are also changed for `gensim_model` after fitting self.model.fit(self.corpus) - self.assertEqual(getattr(self.model.gensim_model, 'normalize'), False) + self.assertEqual(getattr(self.model.gensim_model, 'smartirs'), 'nnn') def testPipeline(self): with open(datapath('mini_newsgroup'), 'rb') as f: diff --git a/gensim/test/test_tfidfmodel.py b/gensim/test/test_tfidfmodel.py index 7f10ded948..32e9ee4d7e 100644 --- a/gensim/test/test_tfidfmodel.py +++ b/gensim/test/test_tfidfmodel.py @@ -38,7 +38,6 @@ class TestTfidfModel(unittest.TestCase): def setUp(self): self.corpus = MmCorpus(datapath('testcorpus.mm')) - self.model = tfidfmodel.TfidfModel(self.corpus, normalize=True) def testTransform(self): # create the transformation model @@ -227,9 +226,9 @@ def TestConsistency(self): self.assertTrue(np.allclose(transformed_docs[0], expected_docs[0])) self.assertTrue(np.allclose(transformed_docs[1], expected_docs[1])) - # endclass TestTfidfModel + if __name__ == '__main__': logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.DEBUG) unittest.main()