From d008d44a34f8f87a935e6b45702a3685b331afa2 Mon Sep 17 00:00:00 2001 From: Przemo Firszt Date: Sat, 24 Jul 2021 21:00:20 +0100 Subject: [PATCH] [UnitTest] Fix UnitTests - use utf-8 On some systems there is a problem with utf-8 during testing. This commit is trying to address it. Tested only on ubuntu 20.04 Signed-off-by: Przemo Firszt --- src/Mod/Test/UnitTests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Mod/Test/UnitTests.py b/src/Mod/Test/UnitTests.py index 5b896da80f..6584ae6fc5 100644 --- a/src/Mod/Test/UnitTests.py +++ b/src/Mod/Test/UnitTests.py @@ -125,9 +125,10 @@ class UnitBasicCases(unittest.TestCase): try: q2 = FreeCAD.Units.Quantity(t[0]) if math.fabs(q1.Value - q2.Value) > 0.01: - print (q1, " : ", q2, " : ", t, " : ", i, " : ", val) + print (u" {} : {} : {} : {} : {}".format(q1,q2, t, i, val).encode("utf-8").strip()) except Exception as e: - print ("{}: {}".format(str(e), t[0])) + s = "{}: {}".format(e, t[0]) + print (u" ".join(e).encode("utf-8").strip()) def testVoltage(self): q1 = FreeCAD.Units.Quantity("1e20 V")