Commit df244884 by Jason Rhinelander Committed by Wenzel Jakob

Skip .match on older pytest (pre-3.0)

Fixes test failure on Fedora 25.
parent 0861be05
...@@ -34,8 +34,10 @@ def test_named_arguments(msg): ...@@ -34,8 +34,10 @@ def test_named_arguments(msg):
with pytest.raises(TypeError) as excinfo: with pytest.raises(TypeError) as excinfo:
# noinspection PyArgumentList # noinspection PyArgumentList
kw_func2(x=5, y=10, z=12) kw_func2(x=5, y=10, z=12)
assert excinfo.match( if hasattr(excinfo, "match"): # (pytest <3.0 doesn't have `.match()`)
r'(?s)^kw_func2\(\): incompatible.*Invoked with: kwargs: ((x=5|y=10|z=12)(, |$))' + '{3}$') assert excinfo.match(
r'(?s)^kw_func2\(\): incompatible.*Invoked with: kwargs: ((x=5|y=10|z=12)(, |$))' +
'{3}$')
assert kw_func4() == "{13 17}" assert kw_func4() == "{13 17}"
assert kw_func4(myList=[1, 2, 3]) == "{1 2 3}" assert kw_func4(myList=[1, 2, 3]) == "{1 2 3}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment