Skip to content

Commit 6e67f0a

Browse files
committed
TST: unicode compat for test_astype_unicode (GH7758)
1 parent 0568ed7 commit 6e67f0a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/tests/test_series.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -4871,11 +4871,13 @@ def test_astype_str(self):
48714871
assert_series_equal(res, expec)
48724872

48734873
def test_astype_unicode(self):
4874+
4875+
# GH7758
48744876
# a bit of magic is required to set default encoding encoding to utf-8
48754877
digits = string.digits
48764878
test_series = [
48774879
Series([digits * 10, tm.rands(63), tm.rands(64), tm.rands(1000)]),
4878-
Series([u"データーサイエンス、お前はもう死んでいる"]),
4880+
Series([u('データーサイエンス、お前はもう死んでいる')]),
48794881

48804882
]
48814883

@@ -4887,7 +4889,7 @@ def test_astype_unicode(self):
48874889
reload(sys)
48884890
sys.setdefaultencoding("utf-8")
48894891
if sys.getdefaultencoding() == "utf-8":
4890-
test_series.append(Series([u"野菜食べないとやばい".encode("utf-8")]))
4892+
test_series.append(Series([u('野菜食べないとやばい').encode("utf-8")]))
48914893
for s in test_series:
48924894
res = s.astype("unicode")
48934895
expec = s.map(compat.text_type)

0 commit comments

Comments
 (0)