File tree 2 files changed +32
-0
lines changed 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 27
27
from pandas .util .testing import (assert_almost_equal ,
28
28
assert_series_equal ,
29
29
assert_frame_equal )
30
+ from pandas .util import py3compat
30
31
31
32
import pandas .util .testing as tm
32
33
import pandas .lib as lib
@@ -2916,6 +2917,21 @@ def test_repr_unicode(self):
2916
2917
result = repr (df )
2917
2918
self .assertEqual (result .split ('\n ' )[0 ].rstrip (), ex_top )
2918
2919
2920
+ def test_unicode_string_with_unicode (self ):
2921
+ df = DataFrame ({'A' : [u"\u05d0 " ]})
2922
+
2923
+ if py3compat .PY3 :
2924
+ str (df )
2925
+ else :
2926
+ unicode (df )
2927
+
2928
+ def test_bytestring_with_unicode (self ):
2929
+ df = DataFrame ({'A' : [u"\u05d0 " ]})
2930
+ if py3compat .PY3 :
2931
+ bytes (df )
2932
+ else :
2933
+ str (df )
2934
+
2919
2935
def test_very_wide_info_repr (self ):
2920
2936
df = DataFrame (np .random .randn (10 , 20 ),
2921
2937
columns = [tm .rands (10 ) for _ in xrange (20 )])
Original file line number Diff line number Diff line change @@ -1083,6 +1083,22 @@ def test_repr_should_return_str (self):
1083
1083
df = Series (data ,index = index1 )
1084
1084
self .assertTrue (type (df .__repr__ () == str )) # both py2 / 3
1085
1085
1086
+
1087
+ def test_unicode_string_with_unicode (self ):
1088
+ df = Series ([u"\u05d0 " ],name = u"\u05d1 " )
1089
+ if py3compat .PY3 :
1090
+ str (df )
1091
+ else :
1092
+ unicode (df )
1093
+
1094
+ def test_bytestring_with_unicode (self ):
1095
+ df = Series ([u"\u05d0 " ],name = u"\u05d1 " )
1096
+ if py3compat .PY3 :
1097
+ bytes (df )
1098
+ else :
1099
+ str (df )
1100
+
1101
+
1086
1102
def test_timeseries_repr_object_dtype (self ):
1087
1103
index = Index ([datetime (2000 , 1 , 1 ) + timedelta (i )
1088
1104
for i in range (1000 )], dtype = object )
You can’t perform that action at this time.
0 commit comments