Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
unittestgui.RollbackImporter Class Reference

List of all members.

Public Member Functions

def __init__
def rollbackImports

Public Attributes


Detailed Description

This tricky little class is used to make sure that modules under test
will be reloaded the next time they are imported.

Definition at line 190 of file

Constructor & Destructor Documentation

Definition at line 194 of file

00195     def __init__(self):
00196         self.previousModules = sys.modules.copy()

Member Function Documentation

Definition at line 197 of file

00198     def rollbackImports(self):
00199         for modname in sys.modules.copy().keys():
00200             if not modname in self.previousModules:
00201                 # Force reload when modname next imported
00202                 del(sys.modules[modname])

Here is the call graph for this function:

Member Data Documentation

Definition at line 195 of file

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