summaryrefslogtreecommitdiff
path: root/testtools/testrunner.py
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2017-11-01 12:56:12 +0000
committerMichael Drake <michael.drake@codethink.co.uk>2017-11-26 15:22:48 +0000
commit777093d441ab01e8a15df0cc478cd05c4377c475 (patch)
treec7cec1d209adc7b79b008d53ebb4915878eed85b /testtools/testrunner.py
parent8589835723af7d1bf11924b13e38cf4f818c81ab (diff)
downloadbuildsystem-777093d441ab01e8a15df0cc478cd05c4377c475.tar.gz
Python test runner: Convert from Python 2 to Python 3.tlsa/python-testrunner
Diffstat (limited to 'testtools/testrunner.py')
-rw-r--r--testtools/testrunner.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/testtools/testrunner.py b/testtools/testrunner.py
index 9d3aee8..6648372 100644
--- a/testtools/testrunner.py
+++ b/testtools/testrunner.py
@@ -1,4 +1,4 @@
-#!/bin/python
+#!/usr/bin/python3
#
# Testcase runner for NetSurf projects
#
@@ -13,7 +13,7 @@
import os
import sys
-import Queue
+import queue
import threading
import subprocess
@@ -41,11 +41,11 @@ LOG = open(os.path.join(builddir, "testlog"), "w")
def run_test(test_exe, test_data):
- io_q = Queue.Queue()
+ io_q = queue.Queue()
def output_collector(identifier, stream):
for line in stream:
- io_q.put((identifier, line.rstrip()))
+ io_q.put((identifier, line.decode("utf-8").rstrip()))
if not stream.closed:
stream.close()
@@ -109,7 +109,7 @@ with open(os.path.join(directory, "INDEX"), "r") as TINDEX:
continue
# Found one; decompose
- decomposed = filter(None, line.split('\t'))
+ decomposed = list(filter(None, line.split('\t')))
# Strip whitespace
test = decomposed[0].strip()
@@ -136,7 +136,7 @@ with open(os.path.join(directory, "INDEX"), "r") as TINDEX:
continue
# Found one; decompose
- ddecomposed = filter(None, dline.split('\t'))
+ ddecomposed = list(filter(None, dline.split('\t')))
# Strip whitespace
dtest = ddecomposed[0].strip()