diff --git a/tests/test_xpathfuncs.py b/tests/test_xpathfuncs.py index fc85a63..e37b17f 100644 --- a/tests/test_xpathfuncs.py +++ b/tests/test_xpathfuncs.py @@ -97,7 +97,7 @@ def myfunc(ctx: Any) -> None:

First

""" sel = Selector(text=body) - with pytest.raises(ValueError, match="Unregistered function in myfunc"): + with pytest.raises(ValueError, match=r"Unregistered function(: myfunc)? in myfunc"): sel.xpath("myfunc()") set_xpathfunc("myfunc", myfunc) @@ -105,5 +105,5 @@ def myfunc(ctx: Any) -> None: assert myfunc.call_count == 1 # type: ignore[attr-defined] set_xpathfunc("myfunc", None) - with pytest.raises(ValueError, match="Unregistered function in myfunc"): + with pytest.raises(ValueError, match=r"Unregistered function(: myfunc)? in myfunc"): sel.xpath("myfunc()")