Skip to content

Commit

Permalink
Blocked revisions 71221 via svnmerge
Browse files Browse the repository at this point in the history
........
  r71221 | vinay.sajip | 2009-04-05 04:06:24 -0700 (Sun, 05 Apr 2009) | 1 line

  Issue python#5695: Moved logging.captureWarnings() call inside with statement in WarningsTest.test_warnings.
........
  • Loading branch information
brettcannon committed Apr 5, 2009
1 parent ea26163 commit 5b9082a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/test/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,10 +912,10 @@ def test_encoding_cyrillic_unicode(self):
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")
Expand Down

0 comments on commit 5b9082a

Please sign in to comment.