Skip to content

Commit

Permalink
Make ExceptionInfo.repr change more prominent
Browse files Browse the repository at this point in the history
Related to pytest-dev#5579
  • Loading branch information
nicoddemus committed Jul 23, 2019
1 parent 13c4b7d commit 3c94f32
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -90,6 +90,24 @@ Removals
- `#5412 <https://github.com/pytest-dev/pytest/issues/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
Expand Down

0 comments on commit 3c94f32

Please sign in to comment.