本文整理汇总了Python中common.logger.Logger.startTest方法的典型用法代码示例。如果您正苦于以下问题:Python Logger.startTest方法的具体用法?Python Logger.startTest怎么用?Python Logger.startTest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.logger.Logger
的用法示例。
在下文中一共展示了Logger.startTest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MatchFiles
# 需要导入模块: from common.logger import Logger [as 别名]
# 或者: from common.logger.Logger import startTest [as 别名]
def MatchFiles(checkerFile, c1File, targetArch, debuggableMode):
for testCase in checkerFile.testCases:
if testCase.testArch not in [None, targetArch]:
continue
if testCase.forDebuggable != debuggableMode:
continue
# TODO: Currently does not handle multiple occurrences of the same group
# name, e.g. when a pass is run multiple times. It will always try to
# match a check group against the first output group of the same name.
c1Pass = c1File.findPass(testCase.name)
if c1Pass is None:
Logger.fail("Test case \"{}\" not found in the CFG file".format(testCase.name),
testCase.fileName, testCase.startLineNo)
Logger.startTest(testCase.name)
try:
MatchTestCase(testCase, c1Pass)
Logger.testPassed()
except MatchFailedException as e:
lineNo = c1Pass.startLineNo + e.lineNo
if e.assertion.variant == TestAssertion.Variant.Not:
msg = "NOT assertion matched line {}"
else:
msg = "Assertion could not be matched starting from line {}"
msg = msg.format(lineNo)
Logger.testFailed(msg, e.assertion, e.variables)