From 740e4ecad1b859e1fd728fcbb6ef55df99c47d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Mon, 23 Apr 2018 10:47:52 +0200 Subject: [PATCH] [testsuite] Improve output in case of errors use the msg= option of unittest.assertXyz() to improve the error reporting --- tests/system_tests.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/system_tests.py b/tests/system_tests.py index f35e35e0..f870714b 100644 --- a/tests/system_tests.py +++ b/tests/system_tests.py @@ -506,10 +506,12 @@ def test_run(self): sep='\n' ) - self.assertFalse(timeout["flag"] and "Timeout reached") + self.assertFalse(timeout["flag"], msg="Timeout reached") self.compare_stdout(i, command, processed_stdout, stdout) self.compare_stderr(i, command, processed_stderr, stderr) - self.assertEqual(retval, proc.returncode) + self.assertEqual( + retval, proc.returncode, msg="Return value does not match" + ) class Case(unittest.TestCase): @@ -552,11 +554,15 @@ class Case(unittest.TestCase): unittest.TestCase. This function can be overridden in a child class to implement a custom check. """ - self.assertMultiLineEqual(expected_stdout, got_stdout) + self.assertMultiLineEqual( + expected_stdout, got_stdout, msg="Standard output does not match" + ) def compare_stderr(self, i, command, got_stderr, expected_stderr): """ Same as compare_stdout only for standard-error. """ - self.assertMultiLineEqual(expected_stderr, got_stderr) + self.assertMultiLineEqual( + expected_stderr, got_stderr, msg="Standard error does not match" + ) def expand_variables(self, unexpanded_string): """