(self, report: TestReport)
| 155 | self.append(node) |
| 156 | |
| 157 | def write_captured_output(self, report: TestReport) -> None: |
| 158 | if not self.xml.log_passing_tests and report.passed: |
| 159 | return |
| 160 | |
| 161 | content_out = report.capstdout |
| 162 | content_log = report.caplog |
| 163 | content_err = report.capstderr |
| 164 | if self.xml.logging == class="st">"no": |
| 165 | return |
| 166 | content_all = class="st">"" |
| 167 | if self.xml.logging in [class="st">"log", class="st">"all"]: |
| 168 | content_all = self._prepare_content(content_log, class="st">" Captured Log ") |
| 169 | if self.xml.logging in [class="st">"system-out", class="st">"out-err", class="st">"all"]: |
| 170 | content_all += self._prepare_content(content_out, class="st">" Captured Out ") |
| 171 | self._write_content(report, content_all, class="st">"system-out") |
| 172 | content_all = class="st">"" |
| 173 | if self.xml.logging in [class="st">"system-err", class="st">"out-err", class="st">"all"]: |
| 174 | content_all += self._prepare_content(content_err, class="st">" Captured Err ") |
| 175 | self._write_content(report, content_all, class="st">"system-err") |
| 176 | content_all = class="st">"" |
| 177 | if content_all: |
| 178 | self._write_content(report, content_all, class="st">"system-out") |
| 179 | |
| 180 | def _prepare_content(self, content: str, header: str) -> str: |
| 181 | return class="st">"\n".join([header.center(80, class="st">"-"), content, class="st">""]) |
no test coverage detected