Return a loader, to be sure to interrupt the finder algorithm

This commit is contained in:
Glandos
2018-02-20 22:24:41 +01:00
parent dda9fbc592
commit f8f67db0d9

View File

@@ -11,6 +11,11 @@ from sigal.plugins import compress_assets
CURRENT_DIR = os.path.dirname(__file__)
class ErrorLoader:
def load_module(self, fullname):
raise ImportError
class ModuleMasker:
def __init__(self):
@@ -32,7 +37,7 @@ class ModuleMasker:
def find_module(self, fullname, path=None):
if fullname in self._modules:
raise ImportError
return ErrorLoader()
@pytest.fixture(scope='function')