Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/en/how-to/assert.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ If you want to check if a block of code is raising an exact exception type, you

with pytest.raises(RuntimeError) as excinfo:
foo()
assert excinfo.type is RuntimeError
assert issubclass(excinfo.type, RuntimeError)

The :func:`pytest.raises` call will succeed, even though the function raises :class:`NotImplementedError`, because
:class:`NotImplementedError` is a subclass of :class:`RuntimeError`; however the following `assert` statement will
Expand Down
Loading