This commit is contained in:
palaviv 2016-06-16 21:09:15 +03:00
parent 8ddbca36c9
commit e6ff01ada3
2 changed files with 5 additions and 4 deletions

View File

@ -66,8 +66,8 @@
* Add ``build/`` and ``dist/`` to the default ``--norecursedirs`` list. Thanks
`@mikofski`_ for the report and `@tomviner`_ for the PR (`#1544`_).
* pytest.raises accepts a custom message to raise when no exception accord.
Thanks `@palaviv`_ for the PR.
* pytest.raises accepts a custom message to raise when no exception occurred.
Thanks `@palaviv`_ for the complete PR (`#1616`_).
.. _@milliams: https://github.com/milliams
.. _@csaftoiu: https://github.com/csaftoiu
@ -92,6 +92,7 @@
.. _#1520: https://github.com/pytest-dev/pytest/pull/1520
.. _#372: https://github.com/pytest-dev/pytest/issues/372
.. _#1544: https://github.com/pytest-dev/pytest/issues/1544
.. _#1616: https://github.com/pytest-dev/pytest/pull/1616
**Bug Fixes**

View File

@ -80,7 +80,7 @@ class TestRaises:
with pytest.raises(ValueError):
pass
except pytest.raises.Exception as e:
e.msg == "DID NOT RAISE {0}".format(repr(ValueError))
assert e.msg == "DID NOT RAISE {0}".format(repr(ValueError))
def test_costum_raise_message(self):
message = "TEST_MESSAGE"
@ -92,4 +92,4 @@ class TestRaises:
with pytest.raises(ValueError, message=message):
pass
except pytest.raises.Exception as e:
e.msg == message
assert e.msg == message