Don't hardcode 'std' for captured stdout/stderr.
This will make Item.add_report_sect more usable for plugins. See https://github.com/eisensheng/pytest-catchlog/pull/7
This commit is contained in:
parent
ca460e11e6
commit
c10f483b9f
|
@ -147,8 +147,8 @@ class CaptureManager:
|
|||
|
||||
def suspendcapture_item(self, item, when):
|
||||
out, err = self.suspendcapture()
|
||||
item.add_report_section(when, "out", out)
|
||||
item.add_report_section(when, "err", err)
|
||||
item.add_report_section(when, "stdout", out)
|
||||
item.add_report_section(when, "stderr", err)
|
||||
|
||||
error_capsysfderror = "cannot use capsys and capfd at the same time"
|
||||
|
||||
|
|
|
@ -226,7 +226,7 @@ def pytest_runtest_makereport(item, call):
|
|||
longrepr = item._repr_failure_py(excinfo,
|
||||
style=item.config.option.tbstyle)
|
||||
for rwhen, key, content in item._report_sections:
|
||||
sections.append(("Captured std%s %s" %(key, rwhen), content))
|
||||
sections.append(("Captured %s %s" %(key, rwhen), content))
|
||||
return TestReport(item.nodeid, item.location,
|
||||
keywords, outcome, longrepr, when,
|
||||
sections, duration)
|
||||
|
|
Loading…
Reference in New Issue