def prepare(self, colitem):
needed_collectors = colitem.listchain()<EOL>self._teardown_towards(needed_collectors)<EOL>for col in self.stack:<EOL><INDENT>if hasattr(col, "<STR_LIT>"):<EOL><INDENT>six.reraise(*col._prepare_exc)<EOL><DEDENT><DEDENT>for col in needed_collectors[len(self.stack) :]:<EOL><INDENT>self.stack.append(col)<EOL>try:<EOL><INDENT>col.setup()<EOL><DEDENT>except TEST_OUTCOME:<EOL><INDENT>col._prepare_exc = sys.exc_info()<EOL>raise<EOL><DEDENT><DEDENT>
setup objects along the collector chain to the test-method
            and teardown previously setup objects.