Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
test.test_importhooks.TestImporter Class Reference
Inheritance diagram for test.test_importhooks.TestImporter:
Inheritance graph

List of all members.

Public Member Functions

def __init__
def find_module
def load_module

Public Attributes


Static Public Attributes

dictionary modules

Private Member Functions

def _get__path__

Detailed Description

Definition at line 36 of file

Constructor & Destructor Documentation

Definition at line 52 of file

00053     def __init__(self, path=test_path):
00054         if path != test_path:
00055             # if out class is on sys.path_hooks, we must raise
00056             # ImportError for any path item that we can't handle.
00057             raise ImportError
00058         self.path = path

Here is the caller graph for this function:

Member Function Documentation

Reimplemented in test.test_importhooks.PathImporter, and test.test_importhooks.MetaImporter.

Definition at line 59 of file

00060     def _get__path__(self):
00061         raise NotImplementedError

Here is the caller graph for this function:

def test.test_importhooks.TestImporter.find_module (   self,
  path = None 

Definition at line 62 of file

00063     def find_module(self, fullname, path=None):
00064         if fullname in self.modules:
00065             return self
00066         else:
00067             return None

def test.test_importhooks.TestImporter.load_module (   self,

Definition at line 68 of file

00069     def load_module(self, fullname):
00070         ispkg, code = self.modules[fullname]
00071         mod = sys.modules.setdefault(fullname,imp.new_module(fullname))
00072         mod.__file__ = "<%s>" % self.__class__.__name__
00073         mod.__loader__ = self
00074         if ispkg:
00075             mod.__path__ = self._get__path__()
00076         exec(code, mod.__dict__)
00077         return mod

Here is the call graph for this function:

Member Data Documentation

Initial value:
        "hooktestmodule": (False, test_co),
        "hooktestpackage": (True, test_co),
        "hooktestpackage.sub": (True, test_co),
        "hooktestpackage.sub.subber": (True, test_co),
        "hooktestpackage.oldabs": (False, test2_oldabs_co),
        "hooktestpackage.newabs": (False, test2_newabs_co),
        "hooktestpackage.newrel": (False, test2_newrel_co),
        "hooktestpackage.sub.subber.subest": (True, test2_deeprel_co),
        "hooktestpackage.futrel": (False, test2_futrel_co),
        "sub": (False, test_co),
        "reloadmodule": (False, test_co),

Definition at line 38 of file

Definition at line 57 of file

The documentation for this class was generated from the following file: