Skip to content

Commit

Permalink
Clarify test
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sturdevant <[email protected]>
  • Loading branch information
markstur committed Sep 5, 2024
1 parent 90e0ccb commit 8488582
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/modules/text_embedding/test_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ def test_config_val_to_int():
"number_str": "456",
"number_str2": " 456 ",
"true": True,
"non_int": "oh-oh",
"non_int_str": "non int str",
}
)
expected_default = 12345
Expand All @@ -951,10 +951,10 @@ def test_config_val_to_int():
assert 1 == conf.get("true", expected_default)
assert 1 == int(conf.get("true", expected_default))

assert "oh-oh" == conf.get("non_int", 123) # default not used (got "uh-oh")
assert "non int str" == conf.get("non_int_str", 123) # default not used
# Using a bad config (e.g., some non-integer string) with int() will raise ValueError
with pytest.raises(ValueError):
int(conf.get("non_int", 123)) # default not used, int("uh-oh") raises
int(conf.get("non_int_str", 123)) # default not used, int("non int str") raises


@pytest.mark.parametrize(
Expand Down

0 comments on commit 8488582

Please sign in to comment.