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
This commit is contained in:
Bruno Oliveira 2018-01-30 20:01:50 -02:00
parent 3bc7ced97a
commit 90a8faabba
1 changed files with 2 additions and 2 deletions

View File

@ -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):