From 905c648b99e4b31ca66dc6d087d90c72b38bd861 Mon Sep 17 00:00:00 2001 From: Mathieu Agopian Date: Thu, 1 Aug 2013 11:12:02 +0200 Subject: [PATCH] fixes #335: document ExceptionInfo returned by pytest.raises --- doc/en/assert.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/en/assert.txt b/doc/en/assert.txt index 6411ed596..247522c45 100644 --- a/doc/en/assert.txt +++ b/doc/en/assert.txt @@ -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::