]> granicus.if.org Git - python/commitdiff
Suppress deprecation warnings.
authorRaymond Hettinger <python@rcn.com>
Thu, 28 May 2009 22:46:29 +0000 (22:46 +0000)
committerRaymond Hettinger <python@rcn.com>
Thu, 28 May 2009 22:46:29 +0000 (22:46 +0000)
Lib/test/test_contextlib.py

index c05f37b0ba4e3cb7dc1961d15638cf04d04ab2b5..f97cd81861688c539faf040c0bf6e88227b9c2b0 100644 (file)
@@ -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()