summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpyjutest8
1 files changed, 5 insertions, 3 deletions
diff --git a/pyjutest b/pyjutest
index 49c71de..3bfd9e3 100755
--- a/pyjutest
+++ b/pyjutest
@@ -14,7 +14,7 @@ if len (sys.argv) != 2:
sys.exit(-1)
if os.path.exists('pyjutest.dat'):
- with open('pyjutest.dat', 'r') as dat:
+ with open('pyjutest.dat', 'rb') as dat:
tss = load(dat)
else:
tss = [TestSuite("suite", None)]
@@ -22,13 +22,15 @@ else:
p = Popen(sys.argv[1], shell=True, stdout=PIPE, stderr=PIPE)
out,err = p.communicate()
-tc = TestCase(sys.argv[1], 'sh', 2, out[:-1], err[:-1])
+tc = TestCase(sys.argv[1], 'sh', 2, out[:-1].decode('utf-8'),
+ err[:-1].decode('utf-8'))
+
if p.returncode:
tc.add_failure_info(err, "return: %d" % p.returncode)
tss[0].test_cases.append(tc)
-with open('pyjutest.dat', 'w') as dat:
+with open('pyjutest.dat', 'wb') as dat:
dump(tss, dat)
with open('pyjutest.xml', 'w') as xml: