mirror of
https://github.com/mii443/tokenizers.git
synced 2025-08-22 16:25:30 +00:00
Fix the error test for Python 3.10 (error message is different). (#962)
This commit is contained in:
@ -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(
|
||||
|
@ -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)),
|
||||
|
Reference in New Issue
Block a user