From 554c7dd22f5be8abf8cd447270cec2a1e754631c Mon Sep 17 00:00:00 2001 From: Leifur Halldor Asgeirsson Date: Thu, 18 Feb 2016 17:24:05 -0500 Subject: py3 compatibility for test runner & loader --- src/python/grpcio/tests/_runner.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/python/grpcio/tests/_runner.py') diff --git a/src/python/grpcio/tests/_runner.py b/src/python/grpcio/tests/_runner.py index 3b5ca03dd9..e899154b0b 100644 --- a/src/python/grpcio/tests/_runner.py +++ b/src/python/grpcio/tests/_runner.py @@ -27,7 +27,8 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import cStringIO as StringIO +from __future__ import absolute_import + import collections import fcntl import multiprocessing @@ -41,6 +42,8 @@ import time import unittest import uuid +from six import moves + from tests import _loader from tests import _result @@ -143,7 +146,7 @@ class Runner(object): for case in filtered_cases] case_id_by_case = dict((augmented_case.case, augmented_case.id) for augmented_case in augmented_cases) - result_out = StringIO.StringIO() + result_out = moves.cStringIO() result = _result.TerminalResult( result_out, id_map=lambda case: case_id_by_case[case]) stdout_pipe = CaptureFile(sys.stdout.fileno()) -- cgit v1.2.3