|
31 | 31 | is_interval_dtype,
|
32 | 32 | is_sequence,
|
33 | 33 | is_list_like)
|
34 |
| -from pandas.io.formats.printing import pprint_thing_encoded |
| 34 | +from pandas.io.formats.printing import pprint_thing |
35 | 35 | from pandas.core.algorithms import take_1d
|
36 | 36 | import pandas.core.common as com
|
37 | 37 |
|
@@ -989,16 +989,21 @@ def assert_categorical_equal(left, right, check_dtype=True,
|
989 | 989 |
|
990 | 990 | def raise_assert_detail(obj, message, left, right, diff=None):
|
991 | 991 | if isinstance(left, np.ndarray):
|
992 |
| - left = pprint_thing_encoded(left, |
993 |
| - encoding=pd.options.display.encoding) |
| 992 | + left = pprint_thing(left) |
994 | 993 | elif is_categorical_dtype(left):
|
995 | 994 | left = repr(left)
|
| 995 | + |
| 996 | + if compat.PY2 and isinstance(left, compat.string_types): |
| 997 | + left = left.encode('utf-8') |
| 998 | + |
996 | 999 | if isinstance(right, np.ndarray):
|
997 |
| - right = pprint_thing_encoded(right, |
998 |
| - encoding=pd.options.display.encoding) |
| 1000 | + right = pprint_thing(right) |
999 | 1001 | elif is_categorical_dtype(right):
|
1000 | 1002 | right = repr(right)
|
1001 | 1003 |
|
| 1004 | + if compat.PY2 and isinstance(right, compat.string_types): |
| 1005 | + right = right.encode('utf-8') |
| 1006 | + |
1002 | 1007 | msg = """{obj} are different
|
1003 | 1008 |
|
1004 | 1009 | {message}
|
|
0 commit comments