From 678040267514f8fd1f41b55a91e26b43ad38d294 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Thu, 22 Feb 2018 13:36:43 -0500 Subject: [PATCH] selftests/functional/test_output.py: use command output as text Instead of as bytes in assertions, specially because of a part of it is going to be used as a path. This fixes the following issue: ====================================================================== ERROR: test_default_enabled_plugins (test_output.OutputPluginTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cleber/src/avocado/avocado/selftests/functional/test_output.py", line 509, in test_default_enabled_plugins self.check_output_files(debug_log) File "/home/cleber/src/avocado/avocado/selftests/functional/test_output.py", line 286, in check_output_files json_output_path = os.path.join(base_dir, 'results.json') File "/usr/lib64/python3.6/posixpath.py", line 92, in join genericpath._check_arg_types('join', a, *p) File "/usr/lib64/python3.6/genericpath.py", line 151, in _check_arg_types raise TypeError("Can't mix strings and bytes in path components") from None TypeError: Can't mix strings and bytes in path components Signed-off-by: Cleber Rosa --- selftests/functional/test_output.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selftests/functional/test_output.py b/selftests/functional/test_output.py index 74fa5f82..be42566f 100644 --- a/selftests/functional/test_output.py +++ b/selftests/functional/test_output.py @@ -493,7 +493,7 @@ class OutputPluginTest(unittest.TestCase): cmd_line = ('%s run --job-results-dir %s --sysinfo=off ' 'passtest.py' % (AVOCADO, self.tmpdir)) result = process.run(cmd_line, ignore_status=True) - output = result.stdout + result.stderr + output = result.stdout_text + result.stderr_text expected_rc = exit_codes.AVOCADO_ALL_OK self.assertEqual(result.exit_status, expected_rc, "Avocado did not return rc %d:\n%s" % -- GitLab