Skip to content

Commit 90550b9

Browse files
committed
TST: unicode codec test issue, GH #680
1 parent 49dab2a commit 90550b9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: pandas/tests/test_frame.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -1844,8 +1844,12 @@ def test_to_string_unicode_two(self):
18441844
def test_to_string_with_formatters_unicode(self):
18451845
df = DataFrame({u'c/\u03c3':[1,2,3]})
18461846
result = df.to_string(formatters={u'c/\u03c3': lambda x: '%s' % x})
1847-
assert(result in (' c/\xcf\x83\n0 1 \n1 2 \n2 3 ',
1848-
' c/?\n0 1 \n1 2 \n2 3 ' ))
1847+
unicode_version = u' c/\u03c3\x83\n0 1 \n1 2 \n2 3 '
1848+
assert(result in
1849+
(' c/\xcf\x83\n0 1 \n1 2 \n2 3 ',
1850+
unicode_version.encode('cp437', 'replace'),
1851+
unicode_version.encode('latin1', 'replace'),
1852+
' c/?\n0 1 \n1 2 \n2 3 ' ))
18491853

18501854
def test_head_tail(self):
18511855
assert_frame_equal(self.frame.head(), self.frame[:5])

0 commit comments

Comments
 (0)