[Python-checkins] r62893 - python/trunk/Doc/library/test.rst

brett.cannon python-checkins at python.org
Thu May 8 22:20:54 CEST 2008


Author: brett.cannon
Date: Thu May  8 22:20:54 2008
New Revision: 62893

Log:
Document the 'record' argument for test.test_support.catch_warning().


Modified:
   python/trunk/Doc/library/test.rst

Modified: python/trunk/Doc/library/test.rst
==============================================================================
--- python/trunk/Doc/library/test.rst	(original)
+++ python/trunk/Doc/library/test.rst	Thu May  8 22:20:54 2008
@@ -283,13 +283,15 @@
    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")


More information about the Python-checkins mailing list