Fix the error test for Python 3.10 (error message is different). (#962)

This commit is contained in:
Nicolas Patry
2022-03-23 10:35:58 +01:00
committed by GitHub
parent 5a79b71b1d
commit a5f644616b
2 changed files with 2 additions and 2 deletions

View File

@ -148,7 +148,7 @@ class TestCustomNormalizer:
assert isinstance(bad, Normalizer)
assert isinstance(good, Normalizer)
with pytest.raises(Exception, match="TypeError: normalize()"):
with pytest.raises(Exception, match="TypeError:.*normalize()"):
bad.normalize_str("Hey there!")
assert good.normalize_str("Hey there!") == "Hey you!"
with pytest.raises(

View File

@ -213,7 +213,7 @@ class TestCustomPreTokenizer:
assert isinstance(bad, PreTokenizer)
assert isinstance(good, PreTokenizer)
with pytest.raises(Exception, match="TypeError: pre_tokenize()"):
with pytest.raises(Exception, match="TypeError:.*pre_tokenize()"):
bad.pre_tokenize_str("Hey there!")
assert good.pre_tokenize_str("Hey there!") == [
("Hey there!", (0, 10)),