Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
 Tests were slightly updated according to the changes previously made
 on the `SS3.__apply_fn__ function` (see commit 121ae68).

Additionally, now the world cloud png file is created in a specific path
so that it is removed after completion.
  • Loading branch information
sergioburdisso committed Sep 16, 2021
1 parent 761a518 commit bdc1b19
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/test_pyss3.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,11 @@ def perform_tests_on(fn, value, ngram="chicken", cat="food"):
assert round(fn("xxx", cat), 4) == 0
assert round(fn("the xxx chicken", cat), 4) == 0
assert round(fn("", cat), 4) == 0
assert round(fn("", ""), 4) == 0
with pytest.raises(pyss3.InvalidCategoryError):
fn("chicken", "xxx")
with pytest.raises(pyss3.InvalidCategoryError):
fn("chicken", "")
with pytest.raises(pyss3.InvalidCategoryError):
fn("", "")


def test_pyss3_functions():
Expand Down Expand Up @@ -359,8 +358,8 @@ def test_pyss3_ss3(mockers):
clf.save_wordcloud("sports", size=0)

if PYTHON3:
clf.save_wordcloud("science&technology", n_grams=3) # empty cloud
clf.save_wordcloud("science&technology", plot=True)
clf.save_wordcloud("science&technology", n_grams=3, path="./tests/ss3_models/wc.png")
clf.save_wordcloud("science&technology", plot=True, path="./tests/ss3_models/wc.png")

# cv_m=STR_NORM_GV, sg_m=STR_XAI
clf = SS3(
Expand Down

0 comments on commit bdc1b19

Please sign in to comment.