aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting/core/unit.py
diff options
context:
space:
mode:
authorCédric Ollivier <ollivier.cedric@gmail.com>2019-05-25 09:55:02 +0200
committerCédric Ollivier <ollivier.cedric@gmail.com>2019-05-25 09:55:02 +0200
commit12aa6e34ec1f388a40cb5a00826729f7c0d6f201 (patch)
tree93a47239bb31da0446c9944f1ce7147407178c92 /xtesting/core/unit.py
parent934e90a269ea6b65e38578ac3f9a8bf7fc5212b1 (diff)
Set utf-8 in decode and encode calls
It eases backporting in iruya and hunter as a few logs can't be decoded as ascii [1]. [1] https://build.opnfv.org/ci/job/functest-opnfv-functest-vnf-iruya-juju_epc-run/56/console Change-Id: I09c793469bdf4a679e6ed5a268e705efa5f2a20f Signed-off-by: Cédric Ollivier <ollivier.cedric@gmail.com>
Diffstat (limited to 'xtesting/core/unit.py')
-rw-r--r--xtesting/core/unit.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/xtesting/core/unit.py b/xtesting/core/unit.py
index 8e603ce6..774411a4 100644
--- a/xtesting/core/unit.py
+++ b/xtesting/core/unit.py
@@ -48,7 +48,7 @@ class Suite(testcase.TestCase):
stats = subprocess.Popen(
['subunit-stats'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
output, _ = stats.communicate(stream.read())
- cls.__logger.info("\n\n%s", output.decode())
+ cls.__logger.info("\n\n%s", output.decode("utf-8"))
def generate_xunit(self, stream):
"""Generate junit report from subunit stream
@@ -62,7 +62,7 @@ class Suite(testcase.TestCase):
['subunit2junitxml'], stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
output, _ = stats.communicate(stream.read())
- xml.write(output.decode())
+ xml.write(output.decode("utf-8"))
def generate_html(self, stream):
"""Generate html report from subunit stream