From: Raymond Hettinger Date: Thu, 28 May 2009 22:46:29 +0000 (+0000) Subject: Suppress deprecation warnings. X-Git-Tag: v3.1rc1~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c5b0195ea0f18e8b6243118f74e12b22b6c41518;p=python Suppress deprecation warnings. --- diff --git a/Lib/test/test_contextlib.py b/Lib/test/test_contextlib.py index c05f37b0ba..f97cd81861 100644 --- a/Lib/test/test_contextlib.py +++ b/Lib/test/test_contextlib.py @@ -9,6 +9,7 @@ import unittest import threading from contextlib import * # Tests __all__ from test import support +import warnings class ContextManagerTestCase(unittest.TestCase): @@ -331,7 +332,9 @@ class LockContextTestCase(unittest.TestCase): # This is needed to make the test actually run under regrtest.py! def test_main(): - support.run_unittest(__name__) + with warnings.catch_warnings(): + warnings.simplefilter('ignore') + support.run_unittest(__name__) if __name__ == "__main__": test_main()