diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-02-08 21:57:48 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-02-08 21:57:48 (GMT) |
commit | 490082302779decbaf66a80480ae45fba6ae0e20 (patch) | |
tree | d559eff683af5b3beee37137a96f9cf3ada3c747 /Doc/library/unittest.rst | |
parent | 7b26d7f82f67649a7c72f7bd30bf9248f6f542bc (diff) | |
download | cpython-490082302779decbaf66a80480ae45fba6ae0e20.zip cpython-490082302779decbaf66a80480ae45fba6ae0e20.tar.gz cpython-490082302779decbaf66a80480ae45fba6ae0e20.tar.bz2 |
Merged revisions 78091,78094,78109 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78091 | georg.brandl | 2010-02-07 19:02:22 +0200 (Sun, 07 Feb 2010) | 1 line
Rename "exc_value" attribute on assertRaises context manager to "exception".
........
r78094 | michael.foord | 2010-02-07 20:44:12 +0200 (Sun, 07 Feb 2010) | 1 line
assertRaises as context manager now allows you to access exception as documented
........
r78109 | ezio.melotti | 2010-02-08 23:52:08 +0200 (Mon, 08 Feb 2010) | 1 line
Fix exc_value -> exception in docstring
........
Diffstat (limited to 'Doc/library/unittest.rst')
-rw-r--r-- | Doc/library/unittest.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index fc09aa0..20f775c 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -895,24 +895,24 @@ Test cases do_something() The context manager will store the caught exception object in its - :attr:`exc_value` attribute. This can be useful if the intention + :attr:`exception` attribute. This can be useful if the intention is to perform additional checks on the exception raised:: with self.assertRaises(SomeException) as cm: do_something() - the_exception = cm.exc_value + the_exception = cm.exception self.assertEqual(the_exception.error_code, 3) - .. versionchanged:: 3.1 + .. versionchanged:: 3.1 Added the ability to use :meth:`assertRaises` as a context manager. + .. versionchanged:: 3.2 + Added the :attr:`exception` attribute. + .. deprecated:: 3.1 :meth:`failUnlessRaises`. - .. versionchanged:: 3.2 - Added the :attr:`exc_value` attribute. - .. method:: assertRaisesRegexp(exception, regexp[, callable, ...]) |