in pyscripts/inject_into_junit.py [0:0]
def get_testcase_lines_from_log(self, log_lines, class_name, test_name):
lines_for_junit = []
# PYTEST: HORTON: Exiting function 'test_iothub_device.TestIotHubDeviceClient' 'test_method_call_invoked_from_service'
log_start_tag = "Entering function '{}' '{}'".format(class_name, test_name)
log_end_tag = "Exiting function '{}' '{}'".format(class_name, test_name)
got_start = False
for log_line in log_lines:
if (not got_start) and (log_start_tag in log_line):
got_start = True
if got_start:
lines_for_junit.append(log_line)
if log_end_tag in log_line:
break
if len(lines_for_junit) == 0:
lines_for_junit.append(
"{} ERROR: Did not find any log lines that end with [{}]".format(
__file__, log_start_tag
)
)
return lines_for_junit