From 574dcb5fc863210609133b7cecaf9241ce3ad969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= Date: Tue, 10 Sep 2024 16:07:46 +0200 Subject: [PATCH] formatters: Use format_date() in SummaryFormatter output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The heading of the default SummaryFormatter output didn't use the format_date() wrapper to handle UTC conversions correctly, which meant it output wrong dates for the test runs. Fix this by correctly using the helper. Signed-off-by: Toke Høiland-Jørgensen --- flent/formatters.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flent/formatters.py b/flent/formatters.py index 3fe61596..7bc6527b 100644 --- a/flent/formatters.py +++ b/flent/formatters.py @@ -29,7 +29,7 @@ from functools import reduce from flent import plotters, combiners -from flent.util import classname, format_bytes +from flent.util import classname, format_bytes, format_date from flent.loggers import get_logger try: @@ -351,8 +351,8 @@ def __init__(self, settings): def format(self, results): self.open_output() for r in results: - self.write("\nSummary of %s test run from %s" % (r.meta('NAME'), - r.meta("TIME"))) + self.write(f"\nSummary of {r.meta('NAME')} test run " + f"from {format_date(r.meta('TIME'),'%Y-%m-%d %H:%M:%S')}") if r.meta('TITLE'): self.write("\n Title: '%s'" % r.meta('TITLE')) if self.settings.DATA_CUTOFF: