]> granicus.if.org Git - python/commitdiff
Blocked revisions 71221 via svnmerge
authorBrett Cannon <bcannon@gmail.com>
Sun, 5 Apr 2009 18:57:32 +0000 (18:57 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sun, 5 Apr 2009 18:57:32 +0000 (18:57 +0000)
........
  r71221 | vinay.sajip | 2009-04-05 04:06:24 -0700 (Sun, 05 Apr 2009) | 1 line

  Issue #5695: Moved logging.captureWarnings() call inside with statement in WarningsTest.test_warnings.
........

Lib/test/test_logging.py

index a4da5daa0e39e257042f6392b634b739bb820238..1463cf7a994477b48385233320c226b10e32ac06 100644 (file)
@@ -912,10 +912,10 @@ class EncodingTest(BaseTest):
 class WarningsTest(BaseTest):
 
     def test_warnings(self):
-        logging.captureWarnings(True)
         with warnings.catch_warnings():
-            warnings.filterwarnings("always", category=UserWarning)
+            logging.captureWarnings(True)
             try:
+                warnings.filterwarnings("always", category=UserWarning)
                 file = io.StringIO()
                 h = logging.StreamHandler(file)
                 logger = logging.getLogger("py.warnings")