From 90a8faabbaf22ca376af71cc49d3ab81c510e736 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 30 Jan 2018 20:01:50 -0200 Subject: [PATCH] Fix test for py37 In previous Python versions, the list of warnigns appears like: ... list of emitted warnings is: [UserWarning('user',)]. In Python 3.7 apparently the string representation has been improved to: ... list of emitted warnings is: [UserWarning('user')]. Fix #3011 --- testing/test_recwarn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/test_recwarn.py b/testing/test_recwarn.py index 0c80c169e..f1cf542e9 100644 --- a/testing/test_recwarn.py +++ b/testing/test_recwarn.py @@ -206,13 +206,13 @@ class TestWarns(object): with pytest.warns(RuntimeWarning): warnings.warn("user", UserWarning) excinfo.match(r"DID NOT WARN. No warnings of type \(.+RuntimeWarning.+,\) was emitted. " - r"The list of emitted warnings is: \[UserWarning\('user',\)\].") + r"The list of emitted warnings is: \[UserWarning\('user',?\)\].") with pytest.raises(pytest.fail.Exception) as excinfo: with pytest.warns(UserWarning): warnings.warn("runtime", RuntimeWarning) excinfo.match(r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) was emitted. " - r"The list of emitted warnings is: \[RuntimeWarning\('runtime',\)\].") + r"The list of emitted warnings is: \[RuntimeWarning\('runtime',?\)\].") with pytest.raises(pytest.fail.Exception) as excinfo: with pytest.warns(UserWarning):