Skip to content

Commit

Permalink
Update test_laser_tokenizer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
NIXBLACK11 authored Nov 19, 2023
1 parent e565b58 commit d6963b8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions laser_encoders/test_laser_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,22 @@ def test_encoder_non_normalization(tmp_path: Path, test_readme_params: dict):


def test_optional_lang_with_laser2(tmp_path: Path):
with pytest.warns(UserWarning, match="The 'lang' parameter is optional when using 'laser2'. It will be ignored."):
with pytest.warns(
UserWarning,
match="The 'lang' parameter is optional when using 'laser2'. It will be ignored."
):
encoder = LaserEncoderPipeline(lang="en", laser="laser2", model_dir=tmp_path)


def test_required_lang_with_laser3(tmp_path: Path):
with pytest.raises(ValueError, match="For 'laser3', the 'lang' parameter is required."):
with pytest.raises(
ValueError,match="For 'laser3', the 'lang' parameter is required."
):
encoder = LaserEncoderPipeline(laser="laser3", model_dir=tmp_path)


def test_missing_lang_and_laser(tmp_path: Path):
with pytest.raises(ValueError, match="Either 'laser' or 'lang' should be provided."):
with pytest.raises(
ValueError, match="Either 'laser' or 'lang' should be provided."
):
encoder = LaserEncoderPipeline(model_dir=tmp_path)

0 comments on commit d6963b8

Please sign in to comment.