From 1b621ed595cc06154695364392b6d621ed8ff15d Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Fri, 24 Aug 2018 10:57:32 -0400 Subject: [PATCH] Fix unit tests in python3 Fix the check_output in unit tests, the result was being intrepid as a byte string which caused unit tests to fail. This patch makes it a utf-8 string. Change-Id: Iba5c50762846ef5266eddd397aca44b01d411354 Signed-off-by: Chuck Short --- tests/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/base.py b/tests/base.py index d0e04d8fe..b9517414c 100644 --- a/tests/base.py +++ b/tests/base.py @@ -38,7 +38,7 @@ class ScriptTestBase(base.BaseTestCase): try: return subprocess.check_output(cmd, stderr=subprocess.STDOUT, - env=self.env) + env=self.env).decode('utf-8') # NOTE(bnemec): If we don't handle this exception, all we get is the # exit code if the command fails. except subprocess.CalledProcessError as e: