diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2014-01-07 03:49:04 (GMT) |
---|---|---|
committer | Eric Snow <ericsnowcurrently@gmail.com> | 2014-01-07 03:49:04 (GMT) |
commit | 1500d49c22e1a38d186f2dddfa6ba2c5a6cd7d5e (patch) | |
tree | ee32b3fd82c294c8bf257949a22481121d8ef246 /Lib/test/test_importlib/test_abc.py | |
parent | 02b9f9d6bb596d437ac10d71afac8a4781d18d86 (diff) | |
download | cpython-1500d49c22e1a38d186f2dddfa6ba2c5a6cd7d5e.zip cpython-1500d49c22e1a38d186f2dddfa6ba2c5a6cd7d5e.tar.gz cpython-1500d49c22e1a38d186f2dddfa6ba2c5a6cd7d5e.tar.bz2 |
Issue 19713: Add PEP 451-related deprecations.
Diffstat (limited to 'Lib/test/test_importlib/test_abc.py')
-rw-r--r-- | Lib/test/test_importlib/test_abc.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Lib/test/test_importlib/test_abc.py b/Lib/test/test_importlib/test_abc.py index ba8d605..7c8e8fe 100644 --- a/Lib/test/test_importlib/test_abc.py +++ b/Lib/test/test_importlib/test_abc.py @@ -8,6 +8,7 @@ from test import support import types import unittest from unittest import mock +import warnings from . import util @@ -388,7 +389,9 @@ class InspectLoaderLoadModuleTests: mocked_get_code.side_effect = ImportError with self.assertRaises(ImportError): loader = self.InspectLoaderSubclass() - loader.load_module(self.module_name) + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + loader.load_module(self.module_name) def test_get_code_None(self): # If get_code() returns None, raise ImportError. @@ -631,7 +634,9 @@ class SourceOnlyLoaderTests(SourceLoaderTestHarness): # __path__ (for packages), __file__, and __cached__. # The module should also be put into sys.modules. with util.uncache(self.name): - module = self.loader.load_module(self.name) + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + module = self.loader.load_module(self.name) self.verify_module(module) self.assertEqual(module.__path__, [os.path.dirname(self.path)]) self.assertIn(self.name, sys.modules) @@ -642,7 +647,9 @@ class SourceOnlyLoaderTests(SourceLoaderTestHarness): # Testing the values for a package are covered by test_load_module. self.setUp(is_package=False) with util.uncache(self.name): - module = self.loader.load_module(self.name) + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + module = self.loader.load_module(self.name) self.verify_module(module) self.assertTrue(not hasattr(module, '__path__')) |