From 217c9ebe84919d956922a854f25d4e70408504f3 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Mon, 3 Sep 2018 09:00:22 -0500 Subject: [PATCH] Testing: Don't convert tested strings to unicode before trying to truncate them --- spyder/widgets/tests/test_findinfiles.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spyder/widgets/tests/test_findinfiles.py b/spyder/widgets/tests/test_findinfiles.py index e7bb93c9282..1d608f4afad 100644 --- a/spyder/widgets/tests/test_findinfiles.py +++ b/spyder/widgets/tests/test_findinfiles.py @@ -178,12 +178,14 @@ def test_truncate_result_with_different_input(qtbot, line_input): slice_end = 2 if PY2: - line_input = line_input.decode('utf-8') + line_input_expected = line_input.decode('utf-8') + else: + line_input_expected = line_input expected_result = u'%s%s%s' % ( - line_input[:slice_start], - line_input[slice_start:slice_end], - line_input[slice_end:]) + line_input_expected[:slice_start], + line_input_expected[slice_start:slice_end], + line_input_expected[slice_end:]) # when truncated_line = find_in_files.result_browser.truncate_result(