]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #19758: silence PendingDeprecationWarnings in test_importlib.
authorEric Snow <ericsnowcurrently@gmail.com>
Sun, 8 Dec 2013 02:37:31 +0000 (19:37 -0700)
committerEric Snow <ericsnowcurrently@gmail.com>
Sun, 8 Dec 2013 02:37:31 +0000 (19:37 -0700)
Lib/test/test_importlib/test_spec.py

index e4ef39fd295d661adca811b920ed2e20d03bbde1..9e73df8feefeda1d2086295e80697e2a072043ba 100644 (file)
@@ -10,6 +10,7 @@ import os.path
 from test.support import CleanImport
 import unittest
 import sys
+import warnings
 
 
 
@@ -55,10 +56,13 @@ class LegacyLoader(TestLoader):
 
     HAM = -1
 
-    @frozen_util.module_for_loader
-    def load_module(self, module):
-        module.ham = self.HAM
-        return module
+    with warnings.catch_warnings():
+        warnings.simplefilter("ignore", PendingDeprecationWarning)
+
+        @frozen_util.module_for_loader
+        def load_module(self, module):
+            module.ham = self.HAM
+            return module
 
 
 class ModuleSpecTests: