本文整理匯總了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()