Christian Heimes added the comment:

How do you like;

class TestPkg(unittest.TestCase):

    def setUp(self):
        self.root = None
        self.syspath = list(sys.path)
        self.sysmodules = sys.modules.copy()

    def tearDown(self):
        sys.path[:] = self.syspath
        sys.modules.clear()
        sys.modules.update(self.sysmodules)
        del self.sysmodules
        cleanout(self.root)

Or I could use the paranoid approach: create set from sys.modules.keys()
in setUp + tearDown and remove the items that are in the second set but
not in the first set.

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1414>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to