From 3c94f32e771532040bb3e003998aedb273805ca7 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 23 Jul 2019 08:42:03 -0300 Subject: [PATCH] Make ExceptionInfo.repr change more prominent Related to #5579 --- CHANGELOG.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f2021c05d..811f7475d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -90,6 +90,24 @@ Removals - `#5412 `_: ``ExceptionInfo`` objects (returned by ``pytest.raises``) now have the same ``str`` representation as ``repr``, which avoids some confusion when users use ``print(e)`` to inspect the object. + This means code like: + + .. code-block:: python + + with pytest.raises(SomeException) as e: + ... + assert "some message" in str(e) + + + Needs to be changed to: + + .. code-block:: python + + with pytest.raises(SomeException) as e: + ... + assert "some message" in str(e.value) + + Deprecations