#NEWLINE# def parse_session_failure( lines ) : #NEWLINE# #INDENT# '\n    Parse the output when *pytest* failed to start a session. One or more\n    traceback block are displayed. Last traceback error is formatted to the\n    plugin errorformat.\n\n    :param lines: list of *pytest* error output lines.\n\n    :returns: *pytest* output augmented with specially formatted lines adapted to\n        this plugin errorformat which will populate Vim clist.\n    ' #NEWLINE# def get_traceback( lines ) : #NEWLINE# #INDENT# ' Iterates  on traceback block found in lines.  ' #NEWLINE# traceback = [ ] #NEWLINE# for line in lines : #NEWLINE# #INDENT# traceback . append ( line ) #NEWLINE# if ( line == '' ) : #NEWLINE# #INDENT# ( yield traceback ) #NEWLINE# traceback = [ ] #NEWLINE# #UNINDENT# #UNINDENT# ( yield traceback ) #NEWLINE# #UNINDENT# tracebacks = list ( get_traceback ( lines ) ) #NEWLINE# last_traceback = iter ( tracebacks [ ( - 1 ) ] ) #NEWLINE# return list ( chain ( chain ( * tracebacks [ : ( - 1 ) ] ) , parse_traceback ( last_traceback ) , last_traceback ) )