aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_kwargs_and_defaults.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_kwargs_and_defaults.py')
-rw-r--r--tests/test_kwargs_and_defaults.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_kwargs_and_defaults.py b/tests/test_kwargs_and_defaults.py
index 90f8489..2b6b94f 100644
--- a/tests/test_kwargs_and_defaults.py
+++ b/tests/test_kwargs_and_defaults.py
@@ -34,8 +34,10 @@ def test_named_arguments(msg):
with pytest.raises(TypeError) as excinfo:
# noinspection PyArgumentList
kw_func2(x=5, y=10, z=12)
- assert excinfo.match(
- r'(?s)^kw_func2\(\): incompatible.*Invoked with: kwargs: ((x=5|y=10|z=12)(, |$))' + '{3}$')
+ if hasattr(excinfo, "match"): # (pytest <3.0 doesn't have `.match()`)
+ 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(myList=[1, 2, 3]) == "{1 2 3}"