Skip to content

Commit

Permalink
Yet another attempt to correct tests failing @ CI (piskvorky#2611)
Browse files Browse the repository at this point in the history
  • Loading branch information
lopusz committed Dec 27, 2019
1 parent 1da1cc8 commit f799652
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gensim/test/test_fasttext.py
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ def _create_and_save_test_model(self, out_base_fname, model_params, fasttext_cmd
subprocess.run(cmd, shell=True)

def _check_roundtrip_file_file(self, model_params):
ft_home = os.environ.get("FT_HOME")
ft_home = os.environ.get("FT_HOME", None)
fasttext_cmd = os.path.join(ft_home, "fasttext")

# fasttext tool creates both *vec and *bin files, so we have to remove both, even thought *vec is unused
Expand All @@ -1536,14 +1536,14 @@ def _check_roundtrip_file_file(self, model_params):
self._compare_fasttext_files(fpath1bin, fpath2bin)

def test_roundtrip_file_file_skipgram(self):
if os.environ.get("FT_HOME") is None:
if os.environ.get("FT_HOME", None) is None:
self.skipTest("FT_HOME env variable not set")
else:
model_params = {"size": 10, "sg": 1, "seed": 42}
self._check_roundtrip_file_file(model_params)

def test_roundtrip_file_file_cbow(self):
if os.environ.get("FT_HOME") is None:
if os.environ.get("FT_HOME", None) is None:
self.skipTest("FT_HOME env variable not set")
else:
model_params = {"size": 10, "sg": 0, "seed": 42}
Expand Down Expand Up @@ -1580,7 +1580,7 @@ def _get_wordvectors_from_fb_fastttext(self, fasttext_cmd, fasttext_fname, words

def _check_load_fasttext_format(self, model_params):

ft_home = os.environ.get("FT_HOME")
ft_home = os.environ.get("FT_HOME", None)
fasttext_cmd = os.path.join(ft_home, "fasttext")

with temporary_file("load_fasttext.bin") as fpath:
Expand All @@ -1593,15 +1593,15 @@ def _check_load_fasttext_format(self, model_params):
self.assertLess(diff, 1.0e-4)

def test_load_fasttext_format_cbow(self):
if os.environ.get("FT_HOME") is None:
if os.environ.get("FT_HOME", None) is None:
self.skipTest("FT_HOME env variable not set")
else:
model_params = {"size": 10, "min_count": 1, "hs": 1, "sg": 0,
"negative": 5, "seed": 42, "workers": 1}
self._check_load_fasttext_format(model_params)

def test_load_fasttext_format_skipgram(self):
if os.environ.get("FT_HOME") is None:
if os.environ.get("FT_HOME", None) is None:
self.skipTest("FT_HOME env variable not set")
else:
model_params = {"size": 10, "min_count": 1, "hs": 1, "sg": 1,
Expand Down

0 comments on commit f799652

Please sign in to comment.