aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_kwargs_and_defaults.py
diff options
context:
space:
mode:
authorJason Rhinelander <jason@imaginary.ca>2017-02-25 16:33:44 -0500
committerWenzel Jakob <wenzel.jakob@epfl.ch>2017-02-26 22:59:13 +0100
commitdf244884c0ecb5bf869d37944ea06aa218a4bc1a (patch)
treefd96040974972e138ff84dd5996220f176d20515 /tests/test_kwargs_and_defaults.py
parent0861be05da6e91efb13b8bf4d6ee01b53dc94a6b (diff)
downloadplatform_external_python_pybind11-df244884c0ecb5bf869d37944ea06aa218a4bc1a.tar.gz
platform_external_python_pybind11-df244884c0ecb5bf869d37944ea06aa218a4bc1a.tar.bz2
platform_external_python_pybind11-df244884c0ecb5bf869d37944ea06aa218a4bc1a.zip
Skip .match on older pytest (pre-3.0)
Fixes test failure on Fedora 25.
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}"