From 0efcf99c9eebfd65f6dd7ecc5c94b1c340ad6513 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Tue, 31 Jul 2012 17:52:32 -0400 Subject: [PATCH] abc fixes. --- Lib/test/test_importlib/source/test_abc_loader.py | 11 +++++++++++ Lib/test/test_importlib/source/test_file_loader.py | 2 ++ 2 files changed, 13 insertions(+) diff --git a/Lib/test/test_importlib/source/test_abc_loader.py b/Lib/test/test_importlib/source/test_abc_loader.py index afcaad0d972..9db48821771 100644 --- a/Lib/test/test_importlib/source/test_abc_loader.py +++ b/Lib/test/test_importlib/source/test_abc_loader.py @@ -32,6 +32,9 @@ class SourceOnlyLoaderMock(abc.SourceLoader): def get_filename(self, fullname): return self.path + def module_repr(self, module): + return '' + class SourceLoaderMock(SourceOnlyLoaderMock): @@ -107,6 +110,9 @@ class PyLoaderMock(abc.PyLoader): assert issubclass(w[0].category, DeprecationWarning) return path + def module_repr(self): + return '' + class PyLoaderCompatMock(PyLoaderMock): @@ -779,11 +785,16 @@ class AbstractMethodImplTests(unittest.TestCase): class Loader(abc.Loader): def load_module(self, fullname): super().load_module(fullname) + def module_repr(self, module): + super().module_repr(module) class Finder(abc.Finder): def find_module(self, _): super().find_module(_) + def find_loader(self, _): + super().find_loader(_) + class ResourceLoader(Loader, abc.ResourceLoader): def get_data(self, _): super().get_data(_) diff --git a/Lib/test/test_importlib/source/test_file_loader.py b/Lib/test/test_importlib/source/test_file_loader.py index c401cf764c5..90f9d30129e 100644 --- a/Lib/test/test_importlib/source/test_file_loader.py +++ b/Lib/test/test_importlib/source/test_file_loader.py @@ -29,6 +29,7 @@ class SimpleTest(unittest.TestCase): # If fullname is not specified that assume self.name is desired. class TesterMixin(importlib.abc.Loader): def load_module(self, fullname): return fullname + def module_repr(self, module): return '' class Tester(importlib.abc.FileLoader, TesterMixin): def get_code(self, _): pass @@ -49,6 +50,7 @@ class SimpleTest(unittest.TestCase): def get_code(self, _): pass def get_source(self, _): pass def is_package(self, _): pass + def module_repr(self, _): pass path = 'some_path' name = 'some_name'