(
cls,
test_report: TestReport,
context: SubtestContext,
captured_output: Captured | None,
captured_logs: CapturedLogs | None,
)
| 111 | |
| 112 | @classmethod |
| 113 | def _new( |
| 114 | cls, |
| 115 | test_report: TestReport, |
| 116 | context: SubtestContext, |
| 117 | captured_output: Captured | None, |
| 118 | captured_logs: CapturedLogs | None, |
| 119 | ) -> Self: |
| 120 | result = super()._from_json(test_report._to_json()) |
| 121 | result.context = context |
| 122 | |
| 123 | if captured_output: |
| 124 | if captured_output.out: |
| 125 | result.sections.append(("Captured stdout call", captured_output.out)) |
| 126 | if captured_output.err: |
| 127 | result.sections.append(("Captured stderr call", captured_output.err)) |
| 128 | |
| 129 | if captured_logs and (log := captured_logs.handler.stream.getvalue()): |
| 130 | result.sections.append(("Captured log call", log)) |
| 131 | |
| 132 | return result |
| 133 | |
| 134 | |
| 135 | @fixture |
no test coverage detected