Skip to content

Commit

Permalink
Unifying testing method names (piskvorky#2611)
Browse files Browse the repository at this point in the history
  • Loading branch information
lopusz committed Jan 8, 2020
1 parent 594ca6b commit 971bfa6
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions gensim/test/test_fasttext.py
Original file line number Diff line number Diff line change
Expand Up @@ -1350,10 +1350,10 @@ def _check_roundtrip(self, sg):
v_loaded = model_loaded.wv[w]
self.assertLess(calc_max_diff(v_orig, v_loaded), MAX_WORDVEC_COMPONENT_DIFFERENCE)

def test_round_trip_skipgram(self):
def test_skipgram(self):
self._check_roundtrip(sg=1)

def test_round_trip_cbow(self):
def test_cbow(self):
self._check_roundtrip(sg=0)


Expand Down Expand Up @@ -1390,10 +1390,10 @@ def _check_roundtrip_file_file(self, sg):
gensim.models.fasttext.save_facebook_model(model, fpath2)
self.assertEqual(_read_binary_file(fpath1), _read_binary_file(fpath2))

def test_roundtrip_file_file_skipgram(self):
def test_skipgram(self):
self._check_roundtrip_file_file(sg=1)

def test_roundtrip_file_file_cbow(self):
def test_cbow(self):
self._check_roundtrip_file_file(sg=0)


Expand Down Expand Up @@ -1435,10 +1435,10 @@ def _check_roundtrip_file_file(self, sg):
gensim.models.fasttext.save_facebook_model(model, fpath2bin)
self.assertEqual(_read_binary_file(fpath1bin), _read_binary_file(fpath2bin))

def test_roundtrip_file_file_skipgram(self):
def test_skipgram(self):
self._check_roundtrip_file_file(sg=1)

def test_roundtrip_file_file_cbow(self):
def test_cbow(self):
self._check_roundtrip_file_file(sg=0)


Expand Down Expand Up @@ -1491,11 +1491,12 @@ def _check_load_fasttext_format(self, sg):
# Because fasttext command line prints vectors with limited accuracy
self.assertLess(diff, 1.0e-4)

def test_load_fasttext_format_cbow(self):
def test_skipgram(self):
self._check_load_fasttext_format(sg=1)

def test_cbow(self):
self._check_load_fasttext_format(sg=0)

def test_load_fasttext_format_skipgram(self):
self._check_load_fasttext_format(sg=1)


if __name__ == '__main__':
Expand Down

0 comments on commit 971bfa6

Please sign in to comment.