diff --git a/tests/test_validators.py b/tests/test_validators.py index 5ad2308eb..8caa64272 100644 --- a/tests/test_validators.py +++ b/tests/test_validators.py @@ -5,6 +5,7 @@ """ import re +import sys import pytest @@ -243,10 +244,13 @@ def test_catches_invalid_func(self): with pytest.raises(ValueError) as ei: matches_re("a", 0, lambda: None) - assert ( - "'func' must be one of None, fullmatch, match, search." - == ei.value.args[0] - ) + if sys.version_info >= (3, 15): + errmsg = ( + "'func' must be one of None, fullmatch, prefixmatch, search." + ) + else: + errmsg = "'func' must be one of None, fullmatch, match, search." + assert errmsg == ei.value.args[0] @pytest.mark.parametrize( "func", [None, getattr(re, "fullmatch", None), re.match, re.search]