Skip to content

Commit a9626d2

Browse files
committed
TST: fix failing unicode comparison test on sparc (with non-standard encoding)
1 parent 1c720f5 commit a9626d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pandas/tests/test_index.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -2221,9 +2221,10 @@ def test_tolist(self):
22212221
self.assertEqual(result, exp)
22222222

22232223
def test_repr_with_unicode_data(self):
2224-
d = {"a": [u("\u05d0"), 2, 3], "b": [4, 5, 6], "c": [7, 8, 9]}
2225-
index = pd.DataFrame(d).set_index(["a", "b"]).index
2226-
self.assertFalse("\\u" in repr(index)) # we don't want unicode-escaped
2224+
with pd.core.config.option_context("display.encoding",'UTF-8'):
2225+
d = {"a": [u("\u05d0"), 2, 3], "b": [4, 5, 6], "c": [7, 8, 9]}
2226+
index = pd.DataFrame(d).set_index(["a", "b"]).index
2227+
self.assertFalse("\\u" in repr(index)) # we don't want unicode-escaped
22272228

22282229
def test_unicode_string_with_unicode(self):
22292230
d = {"a": [u("\u05d0"), 2, 3], "b": [4, 5, 6], "c": [7, 8, 9]}

0 commit comments

Comments
 (0)