From: Eric Snow Date: Sun, 8 Dec 2013 02:37:31 +0000 (-0700) Subject: Issue #19758: silence PendingDeprecationWarnings in test_importlib. X-Git-Tag: v3.4.0b2~303 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5c29424f4bae94e32ec7332551f3ccabf2f957dd;p=thirdparty%2FPython%2Fcpython.git Issue #19758: silence PendingDeprecationWarnings in test_importlib. --- diff --git a/Lib/test/test_importlib/test_spec.py b/Lib/test/test_importlib/test_spec.py index e4ef39fd295d..9e73df8feefe 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: