示例#1
0
 def brainless_manager(self):
     manager = AstroidManager()
     # avoid caching into the AstroidManager borg since we get problems
     # with other tests :
     manager.__dict__ = {}
     manager._failed_import_hooks = []
     manager.astroid_cache = {}
     manager._mod_file_cache = {}
     manager._transform = transforms.TransformVisitor()
     return manager
示例#2
0
def brainless_manager():
    m = manager.AstroidManager()
    # avoid caching into the AstroidManager borg since we get problems
    # with other tests :
    m.__dict__ = {}
    m._failed_import_hooks = []
    m.astroid_cache = {}
    m._mod_file_cache = {}
    m._transform = transforms.TransformVisitor()
    m.extension_package_whitelist = {}
    return m
示例#3
0
    def __init__(self):
        self.__dict__ = AstroidManager.brain
        if not self.__dict__:
            # NOTE: cache entries are added by the [re]builder
            self.astroid_cache = {}
            self._mod_file_cache = {}
            self._failed_import_hooks = []
            self.always_load_extensions = False
            self.optimize_ast = False
            self.extension_package_whitelist = set()
            self._transform = transforms.TransformVisitor()

            # Export these APIs for convenience
            self.register_transform = self._transform.register_transform
            self.unregister_transform = self._transform.unregister_transform
示例#4
0
 def setUp(self):
     self.transformer = transforms.TransformVisitor()