From 2874661d7d079218be251a20c7e88fe36ccb2bee Mon Sep 17 00:00:00 2001 From: Bogdan TELEAGA Date: Sat, 29 Apr 2017 15:45:34 +0200 Subject: [PATCH] Add more tests for np.int64 indexing --- gensim/test/test_corpora.py | 1 + gensim/test/test_doc2vec.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gensim/test/test_corpora.py b/gensim/test/test_corpora.py index 9d0d1c97f0..d9fe49ea69 100644 --- a/gensim/test/test_corpora.py +++ b/gensim/test/test_corpora.py @@ -168,6 +168,7 @@ def test_indexing(self): for idx, doc in enumerate(docs): self.assertEqual(doc, corpus[idx]) + self.assertEqual(doc, corpus[np.int64(idx)]) self.assertEqual(docs, list(corpus[:])) self.assertEqual(docs[0:], list(corpus[0:])) diff --git a/gensim/test/test_doc2vec.py b/gensim/test/test_doc2vec.py index 06065bdc18..cc229415ec 100644 --- a/gensim/test/test_doc2vec.py +++ b/gensim/test/test_doc2vec.py @@ -165,7 +165,7 @@ def test_similarity_unseen_docs(self): def model_sanity(self, model, keep_training=True): """Any non-trivial model on DocsLeeCorpus can pass these sanity checks""" fire1 = 0 # doc 0 sydney fires - fire2 = 8 # doc 8 sydney fires + fire2 = np.int64(8) # doc 8 sydney fires tennis1 = 6 # doc 6 tennis # inferred vector should be top10 close to bulk-trained one