#NEWLINE# def parse_failures( lines ) : #NEWLINE# #INDENT# '\n    Parse and add special markers to all failures found in the `FAILURES`\n    section.\n\n    :param root_dir: This is the test root dir found in the pytest report.\n    :param lines: All reported output lines from the `FAILURES` section.\n\n    :returns: The original input list augmented with special markers where\n        errors were found\n    ' #NEWLINE# result = [ lines . pop ( 0 ) ] #NEWLINE# for failure in group_lines ( result , '_{2,} (?<!Captured stder call).* _{2,}' ) : #NEWLINE# #INDENT# result . extend ( parse_failure ( failure ) ) #NEWLINE# #UNINDENT# return result