Skip to content

Commit

Permalink
Testing: Don't convert tested strings to unicode before trying to tru…
Browse files Browse the repository at this point in the history
…ncate them
  • Loading branch information
ccordoba12 committed Sep 3, 2018
1 parent 50276e2 commit 217c9eb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions spyder/widgets/tests/test_findinfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<b>%s</b>%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(
Expand Down

0 comments on commit 217c9eb

Please sign in to comment.