Skip to content

Commit 7fa2748

Browse files
authored
Merge pull request #5648 from nicoddemus/improve-exc-info-changelog
Make ExceptionInfo.repr change more prominent
2 parents b2839c4 + 3c94f32 commit 7fa2748

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

CHANGELOG.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,24 @@ Removals
9090
- `#5412 <https://github.com/pytest-dev/pytest/issues/5412>`_: ``ExceptionInfo`` objects (returned by ``pytest.raises``) now have the same ``str`` representation as ``repr``, which
9191
avoids some confusion when users use ``print(e)`` to inspect the object.
9292

93+
This means code like:
94+
95+
.. code-block:: python
96+
97+
with pytest.raises(SomeException) as e:
98+
...
99+
assert "some message" in str(e)
100+
101+
102+
Needs to be changed to:
103+
104+
.. code-block:: python
105+
106+
with pytest.raises(SomeException) as e:
107+
...
108+
assert "some message" in str(e.value)
109+
110+
93111
94112
95113
Deprecations

0 commit comments

Comments
 (0)