@classmethod<EOL><INDENT>def from_item_and_call(cls, item, call):<DEDENT>
when = call.when<EOL>duration = call.stop - call.start<EOL>keywords = {x: <NUM_LIT:1> for x in item.keywords}<EOL>excinfo = call.excinfo<EOL>sections = []<EOL>if not call.excinfo:<EOL><INDENT>outcome = "<STR_LIT>"<EOL>longrepr = None<EOL><DEDENT>else:<EOL><INDENT>if not isinstance(excinfo, ExceptionInfo):<EOL><INDENT>outcome = "<STR_LIT>"<EOL>longrepr = excinfo<EOL><DEDENT>elif excinfo.errisinstance(skip.Exception):<EOL><INDENT>outcome = "<STR_LIT>"<EOL>r = excinfo._getreprcrash()<EOL>longrepr = (str(r.path), r.lineno, r.message)<EOL><DEDENT>else:<EOL><INDENT>outcome = "<STR_LIT>"<EOL>if call.when == "<STR_LIT>":<EOL><INDENT>longrepr = item.repr_failure(excinfo)<EOL><DEDENT>else:  <EOL><INDENT>longrepr = item._repr_failure_py(<EOL>excinfo, style=item.config.getoption("<STR_LIT>", "<STR_LIT>")<EOL>)<EOL><DEDENT><DEDENT><DEDENT>for rwhen, key, content in item._report_sections:<EOL><INDENT>sections.append(("<STR_LIT>" % (key, rwhen), content))<EOL><DEDENT>return cls(<EOL>item.nodeid,<EOL>item.location,<EOL>keywords,<EOL>outcome,<EOL>longrepr,<EOL>when,<EOL>sections,<EOL>duration,<EOL>user_properties=item.user_properties,<EOL>)<EOL>
Factory method to create and fill a TestReport with standard item and call info.