From: Benjamin Peterson Date: Sun, 29 Mar 2009 03:31:40 +0000 (+0000) Subject: stop the versionchanged directive from hiding the docs X-Git-Tag: v2.7a1~1766 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7233acc5c516125e46828a033c5f847d9af05ef0;p=python stop the versionchanged directive from hiding the docs --- diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 0aa55a6c41..fb5bb86c29 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -672,13 +672,15 @@ Test cases To catch any of a group of exceptions, a tuple containing the exception classes may be passed as *exception*. - .. versionchanged:: 2.7 + If *callable* is omitted or None, returns a context manager so that the + code under test can be written inline rather than as a function:: + + with self.failUnlessRaises(some_error_class): + do_something() - If *callable* is omitted or None, returns a context manager so that the - code under test can be written inline rather than as a function:: + .. versionchanged:: 2.7 + Added the ability to use :meth:`assertRaises` as a context manager. - with self.failUnlessRaises(some_error_class): - do_something() .. method:: failIf(expr[, msg]) assertFalse(expr[, msg])