Skip to content

Commit

Permalink
TestReport.from_item_and_call: use repr_failure directly (#281)
Browse files Browse the repository at this point in the history
It's a wrapper around `_repr_failure_py`, which appears to handle the
tbstyle in the same way.
  • Loading branch information
blueyed committed Mar 12, 2020
1 parent 7f601a9 commit bf41134
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/_pytest/reports.py
Expand Up @@ -290,12 +290,7 @@ def from_item_and_call(cls, item, call) -> "TestReport":
longrepr = (str(r.path), r.lineno, r.message)
else:
outcome = "failed"
if call.when == "call":
longrepr = item.repr_failure(excinfo)
else: # exception in setup or teardown
longrepr = item._repr_failure_py(
excinfo, style=item.config.getoption("tbstyle", "auto")
)
longrepr = item.repr_failure(excinfo)
for rwhen, key, content in item._report_sections:
sections.append(("Captured {} {}".format(key, rwhen), content))
return cls(
Expand Down

0 comments on commit bf41134

Please sign in to comment.