def test_sundry(self): old_modules = import_helper.modules_setup() try: for fn in os.listdir(scriptsdir): if not fn.endswith('.py'): continue name = fn[:-3] if name in self.skiplist: continue import_tool(name) finally: # Unload all modules loaded in this test import_helper.modules_cleanup(*old_modules)
def tearDown(self): sys.path[:] = self.path sys.meta_path[:] = self.meta_path sys.path_hooks[:] = self.path_hooks sys.path_importer_cache.clear() import_helper.modules_cleanup(*self.modules_before)