bpo-42134: Raise ImportWarning when calling find_module() in the import system (GH-25044)

This commit is contained in:
Brett Cannon 2021-03-30 08:43:03 -07:00 committed by GitHub
parent cf35e05f89
commit a7ff6df60c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 1012 additions and 962 deletions

View file

@ -151,6 +151,7 @@ class FindLoaderTests:
with test_util.import_state(meta_path=[self.FakeMetaFinder]):
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
warnings.simplefilter('ignore', ImportWarning)
self.assertEqual((name, None), self.init.find_loader(name))
def test_success_path(self):
@ -161,6 +162,7 @@ class FindLoaderTests:
with test_util.import_state(meta_path=[self.FakeMetaFinder]):
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
warnings.simplefilter('ignore', ImportWarning)
self.assertEqual((name, path),
self.init.find_loader(name, path))