(self)
| 1250 | self._tw.line(content) |
| 1251 | |
| 1252 | def summary_stats(self) -> None: |
| 1253 | if self.verbosity < -1: |
| 1254 | return |
| 1255 | |
| 1256 | session_duration = self._session_start.elapsed() |
| 1257 | (parts, main_color) = self.build_summary_stats_line() |
| 1258 | line_parts = [] |
| 1259 | |
| 1260 | display_sep = self.verbosity >= 0 |
| 1261 | if display_sep: |
| 1262 | fullwidth = self._tw.fullwidth |
| 1263 | for text, markup in parts: |
| 1264 | with_markup = self._tw.markup(text, **markup) |
| 1265 | if display_sep: |
| 1266 | fullwidth += len(with_markup) - len(text) |
| 1267 | line_parts.append(with_markup) |
| 1268 | msg = ", ".join(line_parts) |
| 1269 | |
| 1270 | main_markup = {main_color: True} |
| 1271 | duration = f" in {format_session_duration(session_duration.seconds)}" |
| 1272 | duration_with_markup = self._tw.markup(duration, **main_markup) |
| 1273 | if display_sep: |
| 1274 | fullwidth += len(duration_with_markup) - len(duration) |
| 1275 | msg += duration_with_markup |
| 1276 | |
| 1277 | if display_sep: |
| 1278 | markup_for_end_sep = self._tw.markup("", **main_markup) |
| 1279 | if markup_for_end_sep.endswith("\x1b[0m"): |
| 1280 | markup_for_end_sep = markup_for_end_sep[:-4] |
| 1281 | fullwidth += len(markup_for_end_sep) |
| 1282 | msg += markup_for_end_sep |
| 1283 | |
| 1284 | if display_sep: |
| 1285 | self.write_sep("=", msg, fullwidth=fullwidth, **main_markup) |
| 1286 | else: |
| 1287 | self.write_line(msg, **main_markup) |
| 1288 | |
| 1289 | def short_test_summary(self) -> None: |
| 1290 | if not self.reportchars: |
no test coverage detected