7
7
from .common import Base
8
8
9
9
from pandas .compat import (is_platform_windows , range , lrange , lzip , u ,
10
- zip , PY3 )
10
+ zip , PY3 , PY36 )
11
11
import operator
12
12
import os
13
13
@@ -1775,7 +1775,12 @@ def create_index(self):
1775
1775
def test_order (self ):
1776
1776
idx = self .create_index ()
1777
1777
# 9816 deprecated
1778
- if PY3 :
1778
+ if PY36 :
1779
+ with tm .assertRaisesRegexp (TypeError , "'>' not supported "
1780
+ "between instances of 'str' and 'int'" ):
1781
+ with tm .assert_produces_warning (FutureWarning ):
1782
+ idx .order ()
1783
+ elif PY3 :
1779
1784
with tm .assertRaisesRegexp (TypeError , "unorderable types" ):
1780
1785
with tm .assert_produces_warning (FutureWarning ):
1781
1786
idx .order ()
@@ -1785,7 +1790,11 @@ def test_order(self):
1785
1790
1786
1791
def test_argsort (self ):
1787
1792
idx = self .create_index ()
1788
- if PY3 :
1793
+ if PY36 :
1794
+ with tm .assertRaisesRegexp (TypeError , "'>' not supported "
1795
+ "between instances of 'str' and 'int'" ):
1796
+ result = idx .argsort ()
1797
+ elif PY3 :
1789
1798
with tm .assertRaisesRegexp (TypeError , "unorderable types" ):
1790
1799
result = idx .argsort ()
1791
1800
else :
@@ -1795,7 +1804,11 @@ def test_argsort(self):
1795
1804
1796
1805
def test_numpy_argsort (self ):
1797
1806
idx = self .create_index ()
1798
- if PY3 :
1807
+ if PY36 :
1808
+ with tm .assertRaisesRegexp (TypeError , "'>' not supported "
1809
+ "between instances of 'str' and 'int'" ):
1810
+ result = np .argsort (idx )
1811
+ elif PY3 :
1799
1812
with tm .assertRaisesRegexp (TypeError , "unorderable types" ):
1800
1813
result = np .argsort (idx )
1801
1814
else :
0 commit comments