diff options
Diffstat (limited to 'Lib/test/test_importlib/import_/test_path.py')
-rw-r--r-- | Lib/test/test_importlib/import_/test_path.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_importlib/import_/test_path.py b/Lib/test/test_importlib/import_/test_path.py index 2ba7030d14..57a25228fc 100644 --- a/Lib/test/test_importlib/import_/test_path.py +++ b/Lib/test/test_importlib/import_/test_path.py @@ -75,7 +75,8 @@ class FinderTests: with util.import_state(path_importer_cache={}, path_hooks=[], path=[path_entry]): with warnings.catch_warnings(record=True) as w: - warnings.simplefilter('always') + warnings.simplefilter('always', ImportWarning) + warnings.simplefilter('ignore', DeprecationWarning) self.assertIsNone(self.find('os')) self.assertIsNone(sys.path_importer_cache[path_entry]) self.assertEqual(len(w), 1) @@ -216,7 +217,9 @@ class FinderTests: class FindModuleTests(FinderTests): def find(self, *args, **kwargs): - return self.machinery.PathFinder.find_module(*args, **kwargs) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + return self.machinery.PathFinder.find_module(*args, **kwargs) def check_found(self, found, importer): self.assertIs(found, importer) @@ -278,6 +281,7 @@ class PathEntryFinderTests: path_hooks=[Finder]): with warnings.catch_warnings(): warnings.simplefilter("ignore", ImportWarning) + warnings.simplefilter("ignore", DeprecationWarning) self.machinery.PathFinder.find_module('importlib') |