summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2013-12-08 02:37:31 (GMT)
committerEric Snow <ericsnowcurrently@gmail.com>2013-12-08 02:37:31 (GMT)
commit5c29424f4bae94e32ec7332551f3ccabf2f957dd (patch)
tree7d725e0dcb3417540da8c048916b13735fc946db
parentc0e71cd6e250ad0a5a9170da6993cf4afa0b56d8 (diff)
downloadcpython-5c29424f4bae94e32ec7332551f3ccabf2f957dd.zip
cpython-5c29424f4bae94e32ec7332551f3ccabf2f957dd.tar.gz
cpython-5c29424f4bae94e32ec7332551f3ccabf2f957dd.tar.bz2
Issue #19758: silence PendingDeprecationWarnings in test_importlib.
-rw-r--r--Lib/test/test_importlib/test_spec.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/test_importlib/test_spec.py b/Lib/test/test_importlib/test_spec.py
index e4ef39f..9e73df8 100644
--- a/Lib/test/test_importlib/test_spec.py
+++ b/Lib/test/test_importlib/test_spec.py
@@ -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: