#NEWLINE# def prepare( self , colitem ) : #NEWLINE# #INDENT# ' setup objects along the collector chain to the test-method\n            and teardown previously setup objects.' #NEWLINE# needed_collectors = colitem . listchain ( ) #NEWLINE# self . _teardown_towards ( needed_collectors ) #NEWLINE# for col in self . stack : #NEWLINE# #INDENT# if hasattr ( col , '_prepare_exc' ) : #NEWLINE# #INDENT# py . builtin . _reraise ( * col . _prepare_exc ) #NEWLINE# #UNINDENT# #UNINDENT# for col in needed_collectors [ len ( self . stack ) : ] : #NEWLINE# #INDENT# self . stack . append ( self ) #NEWLINE# try : #NEWLINE# #INDENT# col . setup ( ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# col . _prepare_exc = sys . exc_info ( ) #NEWLINE# raise