本文整理汇总了Python中nose.config.Config.plugins方法的典型用法代码示例。如果您正苦于以下问题:Python Config.plugins方法的具体用法?Python Config.plugins怎么用?Python Config.plugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nose.config.Config
的用法示例。
在下文中一共展示了Config.plugins方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: BlacklistConfig
# 需要导入模块: from nose.config import Config [as 别名]
# 或者: from nose.config.Config import plugins [as 别名]
def BlacklistConfig(blacklist_file, excludes=()):
config = Config()
config.verbosity = 3
config.plugins = BlacklistPlugins(blacklist_file)
if excludes: config.exclude = map(re.compile, excludes)
return config
示例2: Config
# 需要导入模块: from nose.config import Config [as 别名]
# 或者: from nose.config.Config import plugins [as 别名]
# pythonpath
sys.path.append(os.path.join(base_dir, "modules"))
import SeleniumServer
# check if server is up
if not SeleniumServer.have_server():
SeleniumServer.start_server()
c = Config()
# essentially we are going to remove the default discovery method and only use -a as the filter
c.workingDir = os.path.join(base_dir, "scripts")
# apparently you can't overwrite the compiled re, but can control what is used
c.testMatchPat = r'^.*$'
# load the built-in plugins; need the attr and xunit ones specifically
pm = nose.plugins.manager.BuiltinPluginManager()
pm.loadPlugins()
c.plugins = pm
# logging
log_name = os.path.join(base_dir, 'logs', "%s.xml" % time.strftime("%Y-%m-%d-%M-%S"))
sys.argv.extend(['--with-xunit', '--xunit-file', log_name])
print(log_name)
nose.core.run(config = c)
shutil.copy(log_name, os.path.join(base_dir, 'logs', 'latest.xml'))
if os.path.exists(os.path.join(base_dir, "third_party", "selenium", "server.pid")):
SeleniumServer.stop_server()