本文整理汇总了Python中nose.config.Config.testMatchPat方法的典型用法代码示例。如果您正苦于以下问题:Python Config.testMatchPat方法的具体用法?Python Config.testMatchPat怎么用?Python Config.testMatchPat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nose.config.Config
的用法示例。
在下文中一共展示了Config.testMatchPat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Config
# 需要导入模块: from nose.config import Config [as 别名]
# 或者: from nose.config.Config import testMatchPat [as 别名]
base_dir = os.path.dirname(os.path.abspath(__file__))
# 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")):