Skip to content

Commit

Permalink
Update check for error messages to support Python 3.10.
Browse files Browse the repository at this point in the history
  • Loading branch information
doerwalter committed Nov 17, 2021
1 parent fedc4c7 commit 553d56e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/test_ul4.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ def _make_exception_re(*args):
"too many keyword arguments",
"takes no keyword arguments",
"got some positional-only arguments passed as keyword arguments",
"'[a-zA-Z_][a-zA-Z0-9_]*' is an invalid keyword argument for [a-zA-Z_][a-zA-Z0-9_]*\\(\\)",
)

missingkeywordargument = _make_exception_re(
Expand Down Expand Up @@ -2468,7 +2469,7 @@ def test_function_int(T):
with raises(argumentmismatchmessage):
T("<?print int(1, 2, 3)?>").renders()

with raises("int\\(\\) argument must be a string, a bytes-like object or a number, not|int\\(\\) argument must be a string or a number|int\\(null\\) not supported|Can't convert null to int!"):
with raises("int\\(\\) argument must be a string, a bytes-like object or a (real )?number, not|int\\(\\) argument must be a string or a number|int\\(null\\) not supported|Can't convert null to int!"):
T("<?print int(data)?>").renders(data=None)

with raises("invalid literal for int|NumberFormatException"):
Expand Down Expand Up @@ -2499,7 +2500,7 @@ def test_function_float(T):
with raises(argumentmismatchmessage):
T("<?print float(1, 2, 3)?>").renders()

with raises("float\\(\\) argument must be a string or a number|float\\(null\\) not supported|Can't convert null to float!"):
with raises("float\\(\\) argument must be a string or a (real )?number|float\\(null\\) not supported|Can't convert null to float!"):
t.renders(data=None)

with raises(unknownkeywordargument):
Expand Down

0 comments on commit 553d56e

Please sign in to comment.