mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Tests: Set sys.stdout as utf8
This commit is contained in:
parent
29d155afd7
commit
6d147cc99a
1 changed files with 13 additions and 1 deletions
14
test/run_all
14
test/run_all
|
@ -12,6 +12,9 @@ from multiprocessing import cpu_count
|
|||
from threading import Thread
|
||||
from subprocess import call, Popen, PIPE
|
||||
|
||||
if sys.version_info > (3,):
|
||||
import codecs
|
||||
|
||||
try:
|
||||
# python 2
|
||||
from Queue import Queue, Empty
|
||||
|
@ -19,6 +22,9 @@ except ImportError:
|
|||
# python 3
|
||||
from queue import Queue, Empty
|
||||
|
||||
# Look for taskd in $PATH instead of task/src/
|
||||
os.environ["TASKD_USE_PATH"] = "1"
|
||||
|
||||
TIMEOUT = .2
|
||||
|
||||
|
||||
|
@ -57,7 +63,10 @@ def run_test(testqueue, outqueue, threadname):
|
|||
class TestRunner(object):
|
||||
def __init__(self):
|
||||
self.threads = []
|
||||
self.tap = open(cmd_args.tapfile, 'w')
|
||||
if sys.version_info > (3,):
|
||||
self.tap = open(cmd_args.tapfile, 'w', errors='ignore')
|
||||
else:
|
||||
self.tap = open(cmd_args.tapfile, 'w')
|
||||
|
||||
self._parallelq = Queue()
|
||||
self._serialq = Queue()
|
||||
|
@ -194,6 +203,9 @@ def parse_args():
|
|||
|
||||
|
||||
def main():
|
||||
if sys.version_info > (3,):
|
||||
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
|
||||
|
||||
runner = TestRunner()
|
||||
runner.start()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue