bpo-43672: raise ImportWarning when calling find_loader() (GH-25119)

This commit is contained in:
Brett Cannon 2021-04-02 12:35:32 -07:00 committed by GitHub
parent ad442a674c
commit f97dc80068
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 610 additions and 616 deletions

View file

@ -221,13 +221,13 @@ class LoaderDefaultsTests(ABCTestHarness):
def test_module_repr(self):
mod = types.ModuleType('blah')
with warnings.catch_warnings():
warnings.simplefilter("ignore")
warnings.simplefilter("ignore", DeprecationWarning)
with self.assertRaises(NotImplementedError):
self.ins.module_repr(mod)
original_repr = repr(mod)
mod.__loader__ = self.ins
# Should still return a proper repr.
self.assertTrue(repr(mod))
original_repr = repr(mod)
mod.__loader__ = self.ins
# Should still return a proper repr.
self.assertTrue(repr(mod))
(Frozen_LDefaultTests,