From 7233acc5c516125e46828a033c5f847d9af05ef0 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sun, 29 Mar 2009 03:31:40 +0000 Subject: [PATCH] stop the versionchanged directive from hiding the docs --- Doc/library/unittest.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 0aa55a6c41f..fb5bb86c295 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*. + 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() + .. versionchanged:: 2.7 + Added the ability to use :meth:`assertRaises` as a context manager. - 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() .. method:: failIf(expr[, msg]) assertFalse(expr[, msg])