def tearDown(self): sys.path[:] = self.syspath support.modules_cleanup(*self.modules_before) cleanout(self.root) # delete all modules concerning the tested hiearchy if self.pkgname: modules = [name for name in sys.modules if self.pkgname in name.split('.')] for name in modules: del sys.modules[name]
def tearDown(self): sys.path[:] = self.syspath support.modules_cleanup(*self.modules_before) if self.root: # Only clean if the test was actually run cleanout(self.root) # delete all modules concerning the tested hierarchy if self.pkgname: modules = [name for name in sys.modules if self.pkgname in name.split(".")] for name in modules: del sys.modules[name]
def tearDown(self): sys.path[:] = self.syspath support.modules_cleanup(*self.modules_before) if self.root: cleanout(self.root) if self.pkgname: modules = [ name for name in sys.modules if self.pkgname in name.split('.') ] for name in modules: del sys.modules[name]
def tearDown(self): sys.path[:] = self.syspath support.modules_cleanup(*self.modules_before) if self.root: # Only clean if the test was actually run cleanout(self.root) # delete all modules concerning the tested hierarchy if self.pkgname: modules = [name for name in sys.modules if self.pkgname in name.split('.')] for name in modules: del sys.modules[name]
def test_sundry(self): old_modules = support.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 support.modules_cleanup(*old_modules)
def test_sundry(self): old_modules = support.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 support.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() support.modules_cleanup(*self.modules_before)
def tearDown(self): sys.path[:] = self.path sys.meta_path[:] = self.meta_path sys.path_hooks[:] = self.path_hooks sys.path_importer_cache.clear() support.modules_cleanup(*self.modules_before)