Skip to content

Commit 0503847

Browse files
committed
refactor: fix 3.12 syntax
1 parent ba33933 commit 0503847

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

anta/result_manager/models.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ class TestResult(BaseTestResult):
178178
def __str__(self) -> str:
179179
"""Return a human readable string of this TestResult."""
180180
results = f"{self.result} [{','.join([str(r.result) for r in self.atomic_results])}]" if self.atomic_results else str(self.result)
181-
return f"Test {self.test} (on {self.name}): {results}{f'\nMessages:\n{"\n".join(self.messages)}' if self.messages else ''}"
181+
lines = "\n".join(self.messages)
182+
messages = f"\nMessages:\n{lines}" if self.messages else ""
183+
return f"Test {self.test} (on {self.name}): {results}{messages}"
182184

183185
def add(self, description: str | None = None, inputs: BaseModel | None = None) -> AtomicTestResult:
184186
"""Create and add a new AtomicTestResult to this TestResult instance.

0 commit comments

Comments
 (0)