From 7fe06d55594c21a27fe0df2ffff149509a192b18 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Tue, 4 Dec 2018 16:11:41 +0100 Subject: [PATCH] topotests: Update json_cmp_result to return readable result Before this update, json_cmp_results which were formatted as strings would not show the error mesage but just an object reference. Signed-off-by: Christian Franke --- tests/topotests/lib/topotest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py index 1bdf8b10d0..f25b066288 100644 --- a/tests/topotests/lib/topotest.py +++ b/tests/topotests/lib/topotest.py @@ -60,6 +60,9 @@ class json_cmp_result(object): "Returns True if there were errors, otherwise False." return len(self.errors) > 0 + def __str__(self): + return '\n'.join(self.errors) + def get_test_logdir(node=None, init=False): """ Return the current test log directory based on PYTEST_CURRENT_TEST -- 2.39.5