From faf37a5888fe76a5070460e77c1d6b64e6e57fcd Mon Sep 17 00:00:00 2001 From: Wainer dos Santos Moschetta Date: Tue, 1 May 2018 14:45:47 -0400 Subject: [PATCH] list plugin: strip trailing whitespace from verbose ouput The 'avocado list -V' prints the list of tests as a matrix with Type, Test and Tag(s) columns. Some lines may get trailing whitespace chars due the method used to align the columns' value. Changed the call to avocado.utils.astring.iter_tabular_output() so that trailing whitespace are removed from each row. Adjusted the PluginsTest.test_list_no_file_loader() test due lack of whitespace on outputs to be compared. Reference: https://trello.com/c/JWeay87z/1045-strip-tabularoutput-lines Signed-off-by: Wainer dos Santos Moschetta --- avocado/plugins/list.py | 3 ++- selftests/functional/test_basic.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/avocado/plugins/list.py b/avocado/plugins/list.py index 3b911b13..238a099a 100644 --- a/avocado/plugins/list.py +++ b/avocado/plugins/list.py @@ -94,7 +94,8 @@ class TestLister(object): output.TERM_SUPPORT.header_str('Test'), output.TERM_SUPPORT.header_str('Tag(s)')) - for line in astring.iter_tabular_output(test_matrix, header=header): + for line in astring.iter_tabular_output(test_matrix, header=header, + strip=True): LOG_UI.debug(line) if self.args.verbose: diff --git a/selftests/functional/test_basic.py b/selftests/functional/test_basic.py index 6118bb5e..8c1326c9 100644 --- a/selftests/functional/test_basic.py +++ b/selftests/functional/test_basic.py @@ -1028,7 +1028,7 @@ class PluginsTest(AbsPluginsTest, unittest.TestCase): "Avocado did not return rc %d:\n%s" % (exit_codes.AVOCADO_ALL_OK, result)) exp = (b"Type Test Tag(s)\n" - b"MISSING this-wont-be-matched \n\n" + b"MISSING this-wont-be-matched\n\n" b"TEST TYPES SUMMARY\n" b"==================\n" b"EXTERNAL: 0\n" -- GitLab