fixes #335: document ExceptionInfo returned by pytest.raises

This commit is contained in:
Mathieu Agopian 2013-08-01 11:12:02 +02:00
parent 1023390f53
commit 905c648b99
1 changed files with 6 additions and 0 deletions

View File

@ -78,6 +78,12 @@ and if you need to have access to the actual exception info you may use::
# do checks related to excinfo.type, excinfo.value, excinfo.traceback
``excinfo`` is a `py.code.ExceptionInfo`_ instance, which is a wrapper around
the actual exception raised.
.. _py.code.ExceptionInfo:
http://pylib.readthedocs.org/en/latest/code.html#py-code-exceptioninfo
If you want to write test code that works on Python 2.4 as well,
you may also use two other ways to test for an expected exception::