From e6ff01ada3d4925b4d5cbebf1a237c897002edcb Mon Sep 17 00:00:00 2001 From: palaviv Date: Thu, 16 Jun 2016 21:09:15 +0300 Subject: [PATCH] CR fixes --- CHANGELOG.rst | 5 +++-- testing/python/raises.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1dcc64f77e7..53e5768eb0f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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** diff --git a/testing/python/raises.py b/testing/python/raises.py index b42f4f54d46..1c8e89be9ae 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -80,7 +80,7 @@ def test_no_raise_message(self): 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 @@ def test_costum_raise_message(self): with pytest.raises(ValueError, message=message): pass except pytest.raises.Exception as e: - e.msg == message + assert e.msg == message