Update to support running benchmark on python3
Fixed a TypeError when running with python3, and also added a 'benchmark3' target to run it on python3 explicitly. Change-Id: Ia3514465f7d1e97845891cf9aaabcf93e36e0f57
This commit is contained in:
parent
fbc837e75a
commit
cfc7838f8c
@ -18,6 +18,7 @@ from __future__ import print_function
|
|||||||
import atexit
|
import atexit
|
||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
|
import six
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import timeit
|
import timeit
|
||||||
@ -34,6 +35,9 @@ def run_plain(cmd):
|
|||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
out, err = obj.communicate()
|
out, err = obj.communicate()
|
||||||
|
if six.PY3:
|
||||||
|
out = os.fsdecode(out)
|
||||||
|
err = os.fsdecode(err)
|
||||||
return obj.returncode, out, err
|
return obj.returncode, out, err
|
||||||
|
|
||||||
|
|
||||||
|
4
tox.ini
4
tox.ini
@ -44,6 +44,10 @@ exclude = .tox,dist,doc,*.egg,build
|
|||||||
[testenv:benchmark]
|
[testenv:benchmark]
|
||||||
commands = python benchmark/benchmark.py
|
commands = python benchmark/benchmark.py
|
||||||
|
|
||||||
|
[testenv:benchmark3]
|
||||||
|
basepython = python3
|
||||||
|
commands = python3 benchmark/benchmark.py
|
||||||
|
|
||||||
[testenv:pip-missing-reqs]
|
[testenv:pip-missing-reqs]
|
||||||
# do not install test-requirements as that will pollute the virtualenv for
|
# do not install test-requirements as that will pollute the virtualenv for
|
||||||
# determining missing packages
|
# determining missing packages
|
||||||
|
Loading…
Reference in New Issue
Block a user