Skip to content

Commit bf41134

Browse files
authored
TestReport.from_item_and_call: use repr_failure directly (#281)
It's a wrapper around `_repr_failure_py`, which appears to handle the tbstyle in the same way.
1 parent 7f601a9 commit bf41134

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/_pytest/reports.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,7 @@ def from_item_and_call(cls, item, call) -> "TestReport":
290290
longrepr = (str(r.path), r.lineno, r.message)
291291
else:
292292
outcome = "failed"
293-
if call.when == "call":
294-
longrepr = item.repr_failure(excinfo)
295-
else: # exception in setup or teardown
296-
longrepr = item._repr_failure_py(
297-
excinfo, style=item.config.getoption("tbstyle", "auto")
298-
)
293+
longrepr = item.repr_failure(excinfo)
299294
for rwhen, key, content in item._report_sections:
300295
sections.append(("Captured {} {}".format(key, rwhen), content))
301296
return cls(

0 commit comments

Comments
 (0)