basic tests for a finder to pass abc abstractmethod def testmoduleself test importing a toplevel module pass abc abstractmethod def testpackageself test importing a package pass abc abstractmethod def testmoduleinpackageself test importing a module contained within a package a value for path should be used if for a metapath finder pass abc abstractmethod def testpackageinpackageself test importing a subpackage a value for path should be used if for a metapath finder pass abc abstractmethod def testpackageovermoduleself test that packages are chosen over modules pass abc abstractmethod def testfailureself test trying to find a module that cannot be handled pass class loadertestsmetaclassabc abcmeta abc abstractmethod def testmoduleself pass abc abstractmethod def testpackageself pass abc abstractmethod def testlackingparentself if a module is already in sys modules and a reload fails e g a syntaxerror the module should be in the state it was before the reload began pass abc abstractmethod def testunloadableself basic tests for a finder to pass test importing a top level module test importing a package test importing a module contained within a package a value for path should be used if for a meta_path finder test importing a subpackage a value for path should be used if for a meta_path finder test that packages are chosen over modules test trying to find a module that cannot be handled a module should load without issue after the loader returns the module should be in sys modules attributes to verify __file__ __loader__ __name__ no __path__ loading a package should work after the loader returns the module should be in sys modules attributes to verify __name__ __file__ __package__ __path__ __loader__ a loader should not be dependent on it s parent package being imported if a module is already in sys modules and a reload fails e g a syntaxerror the module should be in the state it was before the reload began test importerror is raised when the loader is asked to load a module it can t
import abc


class FinderTests(metaclass=abc.ABCMeta):

    

    @abc.abstractmethod
    def test_module(self):
        
        pass

    @abc.abstractmethod
    def test_package(self):
        
        pass

    @abc.abstractmethod
    def test_module_in_package(self):
        
        
        pass

    @abc.abstractmethod
    def test_package_in_package(self):
        
        
        pass

    @abc.abstractmethod
    def test_package_over_module(self):
        
        pass

    @abc.abstractmethod
    def test_failure(self):
        
        pass


class LoaderTests(metaclass=abc.ABCMeta):

    @abc.abstractmethod
    def test_module(self):
        
        pass

    @abc.abstractmethod
    def test_package(self):
        
        pass

    @abc.abstractmethod
    def test_lacking_parent(self):
        
        pass

    @abc.abstractmethod
    def test_state_after_failure(self):
        
        pass

    @abc.abstractmethod
    def test_unloadable(self):
        
        pass