From 3a58c33c7621392882bdab7303bb345930e0379d Mon Sep 17 00:00:00 2001 From: "brett.cannon" Date: Thu, 8 May 2008 20:20:54 +0000 Subject: [PATCH] Document the 'record' argument for test.test_support.catch_warning(). git-svn-id: http://svn.python.org/projects/python/trunk@62893 6015fed2-1504-0410-9fe1-9d1591cc4771 --- Doc/library/test.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Doc/library/test.rst b/Doc/library/test.rst index 69ead89428..818ff8e707 100644 --- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@ -283,13 +283,15 @@ The :mod:`test.test_support` module defines the following functions: This will run all tests defined in the named module. -.. function:: catch_warning() +.. function:: catch_warning(record=True) - This is a context manager that guards the warnings filter from being + Return a context manager that guards the warnings filter from being permanently changed and records the data of the last warning that has been - issued. + issued. The ``record`` argument specifies whether any raised warnings are + captured by the object returned by :func:`warnings.catch_warning` or allowed + to propagate as normal. - Use like this:: + The context manager is typically used like this:: with catch_warning() as w: warnings.warn("foo") -- 2.11.4.GIT