diff --git a/elementary/monitor/api/tests/tests.py b/elementary/monitor/api/tests/tests.py index 4d603a4ea..6d8ace6f2 100644 --- a/elementary/monitor/api/tests/tests.py +++ b/elementary/monitor/api/tests/tests.py @@ -281,9 +281,11 @@ def _get_invocations( for elementary_unique_id, invocations in grouped_invocations.items(): totals = self._get_test_invocations_totals(invocations) test_invocations[elementary_unique_id] = InvocationsSchema( - fail_rate=round((totals.errors + totals.failures) / len(invocations), 2) - if invocations - else 0, + fail_rate=( + round((totals.errors + totals.failures) / len(invocations), 2) + if invocations + else 0 + ), totals=totals, invocations=invocations, description=self._get_invocations_description(totals), @@ -426,15 +428,17 @@ def _parse_test_db_row(cls, test_db_row: TestDBRowSchema) -> TestSchema: test_db_row.package_name, test_db_row.original_path ), created_at=test_db_row.created_at if test_db_row.created_at else None, - latest_run_time=latest_run_datetime.isoformat() - if latest_run_datetime - else None, - latest_run_time_utc=latest_run_datetime.astimezone(tz.tzlocal()).isoformat() - if latest_run_datetime - else None, - latest_run_status=test_db_row.latest_run_status - if test_db_row.latest_run_status - else None, + latest_run_time=( + latest_run_datetime.astimezone(tz.tzlocal()).isoformat() + if latest_run_datetime + else None + ), + latest_run_time_utc=( + latest_run_datetime.isoformat() if latest_run_datetime else None + ), + latest_run_status=( + test_db_row.latest_run_status if test_db_row.latest_run_status else None + ), ) @staticmethod