bpo-42136: Deprecate module_repr() as found in importlib (GH-25022)

This commit is contained in:
Brett Cannon 2021-03-26 11:55:07 -07:00 committed by GitHub
parent 21a2cabb37
commit 1899087b21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 1545 additions and 1478 deletions

View file

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