#NEWLINE# def parse( lines ) : #NEWLINE# #INDENT# '\n    Parse the pytest report.\n\n    :param lines: List of lines from the pytest report\n\n    :returns: The input lines augmented with special error markers the *Vim*\n        plugin will understand through a custom `errorformat` setting.\n    ' #NEWLINE# sections = parse_sections ( lines ) #NEWLINE# if ( 'session' not in sections ) : #NEWLINE# #INDENT# return parse_session_failure ( lines ) #NEWLINE# #UNINDENT# result = sections [ 'session' ] #NEWLINE# root_dir = parse_session ( sections [ 'session' ] ) #NEWLINE# if ( 'errors' in sections ) : #NEWLINE# #INDENT# result . extend ( parse_errors ( root_dir , sections [ 'errors' ] ) ) #NEWLINE# #UNINDENT# if ( 'failures' in sections ) : #NEWLINE# #INDENT# result . extend ( parse_failures ( sections [ 'failures' ] ) ) #NEWLINE# #UNINDENT# if ( 'summary' in sections ) : #NEWLINE# #INDENT# result . extend ( sections [ 'summary' ] ) #NEWLINE# #UNINDENT# return result