Skip to content

Commit 70f03db

Browse files
authored
Adjustments to assert raises docs (#11586)
Followup from #11578.
1 parent 1e02797 commit 70f03db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/en/how-to/assert.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ If you want to check if a block of code is raising an exact exception type, you
104104

105105
.. code-block:: python
106106
107-
def test_recursion_depth():
107+
def test_foo_not_implemented():
108108
def foo():
109109
raise NotImplementedError
110110
111111
with pytest.raises(RuntimeError) as excinfo:
112112
foo()
113-
assert type(excinfo.value) is RuntimeError
113+
assert excinfo.type is RuntimeError
114114
115115
The :func:`pytest.raises` call will succeed, even though the function raises :class:`NotImplementedError`, because
116116
:class:`NotImplementedError` is a subclass of :class:`RuntimeError`; however the following `assert` statement will

0 commit comments

Comments
 (0)