本文整理汇总了Python中test.support.modules_setup方法的典型用法代码示例。如果您正苦于以下问题:Python support.modules_setup方法的具体用法?Python support.modules_setup怎么用?Python support.modules_setup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test.support
的用法示例。
在下文中一共展示了support.modules_setup方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: modules_setup
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import modules_setup [as 别名]
def modules_setup():
return sys.modules.copy(),
示例2: setUp
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import modules_setup [as 别名]
def setUp(self):
modules = modules_setup()
self.addCleanup(modules_cleanup, *modules)
示例3: setUp
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import modules_setup [as 别名]
def setUp(self):
self.root = None
self.pkgname = None
self.syspath = list(sys.path)
self.modules_before = support.modules_setup()
示例4: setUp
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import modules_setup [as 别名]
def setUp(self):
self.path = sys.path[:]
self.meta_path = sys.meta_path[:]
self.path_hooks = sys.path_hooks[:]
sys.path_importer_cache.clear()
self.modules_before = support.modules_setup()
示例5: test_sundry
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import modules_setup [as 别名]
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)